java-library-template by thriving.dev is licensed under CC BY-NC-SA 4.0
diff --git a/gradle.properties b/gradle.properties index 59a7845..a15aa90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.5.0 +version=1.1.5-SNAPSHOT diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f82469a..25bdaa1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,15 @@ [versions] -snakeyaml = "1.33" -junit = "5.8.1" -assertj = "3.24.2" -testcontainers = "1.18.3" -publish_plugin = "1.3.0" +junit = "5.10.3" +assertj = "3.26.3" +testcontainers = "1.20.0" +publish_plugin = "2.0.0" release_plugin = "3.0.2" [libraries] -snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" } junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } -testcontainers = { module = "org.yaml:snakeyaml", version.ref = "testcontainers" } -testcontainers_junit5 = { module = "org.yaml:snakeyaml", version.ref = "testcontainers" } +testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } +testcontainers_junit5 = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } [bundles] testcontainers_junit = ["testcontainers", "testcontainers_junit5"] diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..2c35211 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c30b486..09523c0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +134,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/java-library-template/.gitignore b/java-library-template/.gitignore deleted file mode 100644 index 06c581c..0000000 --- a/java-library-template/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# gradle locking of dependency versions *required+used for trivy scan only, so do not add to source control -gradle.lockfile diff --git a/java-library-template/build.gradle.kts b/java-library-template/build.gradle.kts index e984cb0..9f96f54 100644 --- a/java-library-template/build.gradle.kts +++ b/java-library-template/build.gradle.kts @@ -13,6 +13,10 @@ object Meta { const val developerOrganizationUrl = "https://thriving.dev" } +java { + sourceCompatibility = JavaVersion.VERSION_21 +} + plugins { // Apply the java-library plugin for API and implementation separation. `java-library` @@ -38,9 +42,6 @@ val intTestImplementation by configurations.getting { configurations["intTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get()) dependencies { - // TODO: remove again after verifying 'trivy scan' & 'renovate' integration works - implementation(libs.snakeyaml) - testImplementation(libs.junit) intTestImplementation(libs.junit) diff --git a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java index 4a51403..dcfa6e2 100644 --- a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java +++ b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java @@ -1,5 +1,6 @@ package dev.thriving.oss.java.library.template; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -17,4 +18,17 @@ void toFunkyCase() { // then assertEquals("hElLo wOrLd!!!", output); } + + @Test + @Disabled // was introduced to verify the 'junit test report' output in CI/CD pipeline results + void toFunkyCaseDisabled() { + // given + String input = "hello world!!!"; + + // when + String output = JavaLibraryTemplate.toFunkyCase(input); + + // then + assertEquals("hElLo wOrLd!!!", output); + } }