diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 2531321..a2e566c 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -9,9 +9,9 @@ name: Java CI with Gradle
on:
push:
- branches: [ develop ]
+ branches: [ main, develop ]
pull_request:
- branches: [ develop ]
+ branches: [ main, develop ]
jobs:
build:
@@ -19,19 +19,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- java-version: '11'
- distribution: 'temurin'
- - name: Build with Gradle
- uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514
- with:
- arguments: build
- env:
- ossrhUsername: ${{secrets.OSSRHUSERNAME}}
- ossrhPassword: ${{secrets.OSSRHPASSWORD}}
- - uses: codecov/codecov-action@v3
- with:
- token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
+ - name: Checkout sources
+ uses: actions/checkout@v4
+ - name: Setup Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+ - name: Execute Gradle build
+ run: ./gradlew build
+ env:
+ ossrhUsername: ${{secrets.OSSRHUSERNAME}}
+ ossrhPassword: ${{secrets.OSSRHPASSWORD}}
+ - uses: codecov/codecov-action@v4
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
diff --git a/.idea/runConfigurations/net_extensions__build___warning_mode_all_.xml b/.idea/runConfigurations/net_extensions__build___warning_mode_all_.xml
new file mode 100644
index 0000000..7fd13cd
--- /dev/null
+++ b/.idea/runConfigurations/net_extensions__build___warning_mode_all_.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+ 5.0
+
+
+
+ false
+ false
+
+
+
diff --git a/.idea/runConfigurations/net_extensions__build___warning_mode_all__.xml b/.idea/runConfigurations/net_extensions__build___warning_mode_all__.xml
index 329dd90..703d1f5 100644
--- a/.idea/runConfigurations/net_extensions__build___warning_mode_all__.xml
+++ b/.idea/runConfigurations/net_extensions__build___warning_mode_all__.xml
@@ -20,4 +20,4 @@
false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__clean_.xml b/.idea/runConfigurations/net_extensions__clean_.xml
index cda7e03..135b5f6 100644
--- a/.idea/runConfigurations/net_extensions__clean_.xml
+++ b/.idea/runConfigurations/net_extensions__clean_.xml
@@ -15,7 +15,19 @@
- true
+ true
+ true
+
+
+
+
+
+ 5.0
+
+
+
+ false
+ false
diff --git a/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_.xml b/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_.xml
index 9d81aac..b93226e 100644
--- a/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_.xml
+++ b/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_.xml
@@ -15,11 +15,12 @@
-
+
true
true
false
+ false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_tagRelease_.xml b/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_tagRelease_.xml
index a8116bd..0827634 100644
--- a/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_tagRelease_.xml
+++ b/.idea/runConfigurations/net_extensions__clean_publishMavenJavaPublicationToMavenLocal_publish_tagRelease_.xml
@@ -16,11 +16,11 @@
-
+
true
true
false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__dependencies_.xml b/.idea/runConfigurations/net_extensions__dependencies_.xml
index 60e8c87..07c076f 100644
--- a/.idea/runConfigurations/net_extensions__dependencies_.xml
+++ b/.idea/runConfigurations/net_extensions__dependencies_.xml
@@ -15,7 +15,19 @@
- true
+ true
+ true
+
+
+
+
+
+ 5.0
+
+
+
+ false
+ false
diff --git a/.idea/runConfigurations/net_extensions__publishMavenJavaPublicationToMavenLocal_.xml b/.idea/runConfigurations/net_extensions__publishMavenJavaPublicationToMavenLocal_.xml
index b5ad459..6a64b77 100644
--- a/.idea/runConfigurations/net_extensions__publishMavenJavaPublicationToMavenLocal_.xml
+++ b/.idea/runConfigurations/net_extensions__publishMavenJavaPublicationToMavenLocal_.xml
@@ -20,4 +20,4 @@
false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__spotlessJavaApply_.xml b/.idea/runConfigurations/net_extensions__spotlessJavaApply_.xml
index 0c210d9..3f84a71 100644
--- a/.idea/runConfigurations/net_extensions__spotlessJavaApply_.xml
+++ b/.idea/runConfigurations/net_extensions__spotlessJavaApply_.xml
@@ -20,4 +20,4 @@
false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__spotlessMiscApply_.xml b/.idea/runConfigurations/net_extensions__spotlessMiscApply_.xml
index cde9524..357114e 100644
--- a/.idea/runConfigurations/net_extensions__spotlessMiscApply_.xml
+++ b/.idea/runConfigurations/net_extensions__spotlessMiscApply_.xml
@@ -17,7 +17,17 @@
true
true
+
+
+
+
+
+ 5.0
+
+
+
false
+ false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__tagRelease_.xml b/.idea/runConfigurations/net_extensions__tagRelease_.xml
index 79c7bd9..de592e0 100644
--- a/.idea/runConfigurations/net_extensions__tagRelease_.xml
+++ b/.idea/runConfigurations/net_extensions__tagRelease_.xml
@@ -13,11 +13,11 @@
-
+
true
true
false
-
\ No newline at end of file
+
diff --git a/.idea/runConfigurations/net_extensions__versionCatalogFormat_.xml b/.idea/runConfigurations/net_extensions__versionCatalogFormat_.xml
new file mode 100644
index 0000000..2d8e885
--- /dev/null
+++ b/.idea/runConfigurations/net_extensions__versionCatalogFormat_.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+ 5.0
+
+
+
+ false
+ false
+
+
+
diff --git a/.idea/runConfigurations/net_extensions__versionCatalogUpdate_.xml b/.idea/runConfigurations/net_extensions__versionCatalogUpdate_.xml
new file mode 100644
index 0000000..8060c9e
--- /dev/null
+++ b/.idea/runConfigurations/net_extensions__versionCatalogUpdate_.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+ 5.0
+
+
+
+ false
+ false
+
+
+
diff --git a/build.gradle b/build.gradle
index 212d321..24bb6ae 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,31 +1,29 @@
-group = "$groupPackage" as Object
-version = "$projectVersion" as Object
-description = "$rootProject.name"
-
buildscript {
repositories {
maven {
- url "https://plugins.gradle.org/m2/"
+ url projectRepositoriesMavenUrl
}
}
- dependencies {
- classpath "io.freefair.gradle:lombok-plugin:$gradlePluginLombokVersion"
- classpath "com.github.ben-manes:gradle-versions-plugin:$gradlePluginVersionsVersion"
- classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$licenseGradlePluginVersion"
- classpath "org.ajoberstar.grgit:grgit-gradle:$grgitGradlePluginVersion"
- classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotlessGradlePluginVersion"
- }
}
-apply plugin: "java"
-apply plugin: "java-library"
-apply plugin: "maven-publish"
-apply plugin: "signing"
-apply plugin: "com.github.ben-manes.versions"
-apply plugin: "com.github.hierynomus.license"
-apply plugin: "jacoco"
-apply plugin: "org.ajoberstar.grgit"
-apply plugin: "com.diffplug.spotless"
+plugins {
+ id 'java'
+ id 'java-library'
+ id 'maven-publish'
+ id 'signing'
+ id 'jacoco'
+ alias(libs.plugins.lombok.plugin)
+ alias(libs.plugins.gradle.versions.plugin)
+ alias(libs.plugins.license.gradle.plugin)
+ alias(libs.plugins.grgit.gradle)
+ alias(libs.plugins.spotless.plugin.gradle)
+ alias(libs.plugins.version.catalog.update)
+}
+
+group = "$groupPackage" as Object
+version = "$projectVersion" as Object
+description = "$rootProject.name"
+
// import gradle files
apply from: "gradle/dependencies.gradle"
apply from: "gradle/formatting.gradle"
@@ -35,13 +33,19 @@ apply from: "gradle/packaging.gradle"
apply from: "gradle/publishing.gradle"
apply from: "gradle/repositories.gradle"
apply from: "gradle/testing.gradle"
+apply from: "gradle/version-catalog-update.gradle"
-sourceCompatibility = "$projectSourceCompatibility" as Object
+java {
+ sourceCompatibility = "$projectSourceCompatibility" as Object
+ toolchain {
+ languageVersion = JavaLanguageVersion.of("$projectSourceCompatibility")
+ }
+}
-tasks.withType(JavaCompile) {
+tasks.withType(JavaCompile).configureEach { javaCompiler ->
options.encoding = "UTF-8"
// uncomment the next line for build with compiler argument -Xlint:deprecation
// options.compilerArgs << "-Xlint:deprecation"
// uncomment the next line for build with compiler argument -Xlint:unchecked
- options.compilerArgs << "-Xlint:unchecked"
+ // options.compilerArgs << "-Xlint:unchecked"
}
diff --git a/gradle.properties b/gradle.properties
index 2fc29a3..adbf6ce 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,7 +3,7 @@
######################
projectVersion=6-SNAPSHOT
groupPackage=io.github.astrapi69
-projectSourceCompatibility=11
+projectSourceCompatibility=17
projectInceptionYear=2015
projectHolderUsername=astrapi69
projectLeaderName=Asterios Raptis
@@ -25,6 +25,9 @@ projectRepositoriesReleasesRepoUrl=https://oss.sonatype.org/service/local/stagin
projectRepositoriesSnapshotsRepoUrl=https://oss.sonatype.org/content/repositories/snapshots
projectRepositoriesUserNameKey=ossrhUsername
projectRepositoriesPasswordKey=ossrhPassword
+projectRepositoriesReleasesName=Sonatype Nexus Releases
+projectRepositoriesSnapshotsName=Sonatype Nexus Snapshots
+projectRepositoriesMavenUrl=https://plugins.gradle.org/m2/
###########################
# gradle-plugins versions #
###########################
diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 2eb08a2..11ddb5b 100644
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -1,9 +1,12 @@
-
dependencies {
- compileOnly("org.projectlombok:lombok:$lombokVersion")
- annotationProcessor("org.projectlombok:lombok:$lombokVersion")
- implementation("io.github.astrapi69:throwable:$throwableVersion")
- testImplementation("io.github.astrapi69:test-object:$testObjectVersion")
- testImplementation("com.jcraft:jsch:$jschVersion")
- testImplementation("org.testng:testng:$testngVersion")
+
+ compileOnly libs.lombok
+ annotationProcessor libs.lombok
+ testCompileOnly libs.lombok
+ testAnnotationProcessor libs.lombok
+
+ implementation libs.throwable
+
+ // Note: use of bundles...
+ testImplementation libs.bundles.unit.testing
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..5396acc
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,34 @@
+[versions]
+gradle-plugin-grgit-version = "5.2.2"
+gradle-plugin-license-version = "0.16.1"
+gradle-plugin-lombok-version = "8.6"
+gradle-plugin-spotless-version = "7.0.0.BETA1"
+gradle-plugin-version-catalog-update-version = "0.8.4"
+gradle-plugin-versions-version = "0.51.0"
+jsch-version = "0.1.55"
+lombok-version = "1.18.26"
+test-object-version = "7.2"
+testng-version = "7.7.1"
+throwable-version = "2.3"
+
+[libraries]
+jsch = { module = "com.jcraft:jsch", version.ref = "jsch-version" }
+lombok = { module = "org.projectlombok:lombok", version.ref = "lombok-version" }
+test-object = { module = "io.github.astrapi69:test-object", version.ref = "test-object-version" }
+testng = { module = "org.testng:testng", version.ref = "testng-version" }
+throwable = { module = "io.github.astrapi69:throwable", version.ref = "throwable-version" }
+
+[bundles]
+unit-testing = [
+ "jsch",
+ "test-object",
+ "testng",
+]
+
+[plugins]
+gradle-versions-plugin = { id = "com.github.ben-manes.versions", version.ref = "gradle-plugin-versions-version" }
+grgit-gradle = { id = "org.ajoberstar.grgit", version.ref = "gradle-plugin-grgit-version" }
+license-gradle-plugin = { id = "com.github.hierynomus.license", version.ref = "gradle-plugin-license-version" }
+lombok-plugin = { id = "io.freefair.lombok", version.ref = "gradle-plugin-lombok-version" }
+spotless-plugin-gradle = { id = "com.diffplug.spotless", version.ref = "gradle-plugin-spotless-version" }
+version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "gradle-plugin-version-catalog-update-version" }
diff --git a/gradle/version-catalog-update.gradle b/gradle/version-catalog-update.gradle
new file mode 100644
index 0000000..2e370bf
--- /dev/null
+++ b/gradle/version-catalog-update.gradle
@@ -0,0 +1,32 @@
+versionCatalogUpdate {
+ // sort the catalog by key (default is true)
+ sortByKey = true
+ // Referenced that are pinned are not automatically updated.
+ // They are also not automatically kept however (use keep for that).
+ pin {
+ // pins all libraries and plugins using the given versions
+ // versions = ["my-version-name", "other-version"]
+ // pins specific libraries that are in the version catalog
+ // libraries = [libs.my.library.reference, libs.my.other.library.reference]
+ // pins specific plugins that are in the version catalog
+ // plugins = [libs.plugins.my.plugin, libs.plugins.my.other.plugin]
+ // pins all libraries (not plugins) for the given groups
+ // groups = ["com.somegroup", "com.someothergroup"]
+ }
+ keep {
+ // keep has the same options as pin to keep specific entries
+ // note that for versions it will ONLY keep the specified version, not all
+ // entries that reference it.
+ // versions = ["my-version-name", "other-version"]
+ // libraries = [libs.my.library.reference, libs.my.other.library.reference]
+ // plugins = [libs.plugins.my.plugin, libs.plugins.my.other.plugin]
+ // groups = ["com.somegroup", "com.someothergroup"]
+
+ // keep versions without any library or plugin reference
+ keepUnusedVersions = true
+ // keep all libraries that aren't used in the project
+ keepUnusedLibraries = true
+ // keep all plugins that aren't used in the project
+ keepUnusedPlugins = true
+ }
+}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index da1db5f..0d18421 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists