diff --git a/.github/actions/test-network-setup/action.yaml b/.github/actions/test-network-setup/action.yaml index bd660f1e..15237892 100644 --- a/.github/actions/test-network-setup/action.yaml +++ b/.github/actions/test-network-setup/action.yaml @@ -9,7 +9,7 @@ inputs: default: 20.x java-version: description: Version of JDK - default: 11.x + default: 25.x fabric-version: description: Version of Hyperledger Fabric default: 2.5.13 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c8bc5766..6a6495c9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,7 +18,7 @@ concurrency: env: GO_VER: "1.23" NODE_VER: 20.x - JAVA_VER: 11.x + JAVA_VER: 25.x jobs: go: diff --git a/asset-transfer-basic/application-gateway-java/build.gradle b/asset-transfer-basic/application-gateway-java/build.gradle index 2a0dfd53..15606e6b 100644 --- a/asset-transfer-basic/application-gateway-java/build.gradle +++ b/asset-transfer-basic/application-gateway-java/build.gradle @@ -27,10 +27,8 @@ dependencies { implementation 'com.google.code.gson:gson:2.11.0' } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { diff --git a/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..a4b76b95 100644 Binary files a/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-basic/application-gateway-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-basic/application-gateway-java/gradlew b/asset-transfer-basic/application-gateway-java/gradlew index 1aa94a42..f5feea6d 100755 --- a/asset-transfer-basic/application-gateway-java/gradlew +++ b/asset-transfer-basic/application-gateway-java/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/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +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 diff --git a/asset-transfer-basic/application-gateway-java/gradlew.bat b/asset-transfer-basic/application-gateway-java/gradlew.bat index 7101f8e4..9b42019c 100644 --- a/asset-transfer-basic/application-gateway-java/gradlew.bat +++ b/asset-transfer-basic/application-gateway-java/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 ########################################################################## diff --git a/asset-transfer-basic/chaincode-java/Dockerfile b/asset-transfer-basic/chaincode-java/Dockerfile index c42f3051..9849aaf4 100755 --- a/asset-transfer-basic/chaincode-java/Dockerfile +++ b/asset-transfer-basic/chaincode-java/Dockerfile @@ -1,30 +1,30 @@ -# the first stage -FROM gradle:8.6-jdk11 AS GRADLE_BUILD +# the first stage +FROM gradle:9-jdk25 AS gradle_build # copy the build.gradle and src code to the container COPY src/ src/ -COPY build.gradle ./ +COPY build.gradle ./ # Build and package our code RUN gradle --no-daemon build shadowJar -x checkstyleMain -x checkstyleTest # the second stage of our build just needs the compiled files -FROM openjdk:11-jre +FROM eclipse-temurin:25-jre ARG CC_SERVER_PORT=9999 # Setup tini to work better handle signals -ENV TINI_VERSION v0.19.0 +ENV TINI_VERSION=v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini RUN addgroup --system javauser && useradd -g javauser javauser # copy only the artifacts we need from the first stage and discard the rest -COPY --chown=javauser:javauser --from=GRADLE_BUILD /home/gradle/build/libs/chaincode.jar /chaincode.jar -COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh +COPY --chown=javauser:javauser --from=gradle_build /home/gradle/build/libs/chaincode.jar /chaincode.jar +COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh -ENV PORT $CC_SERVER_PORT +ENV PORT=$CC_SERVER_PORT EXPOSE $CC_SERVER_PORT USER javauser diff --git a/asset-transfer-basic/chaincode-java/build.gradle b/asset-transfer-basic/chaincode-java/build.gradle index d26c3b68..c10d679f 100644 --- a/asset-transfer-basic/chaincode-java/build.gradle +++ b/asset-transfer-basic/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -13,13 +13,14 @@ group 'org.hyperledger.fabric.samples' version '1.0-SNAPSHOT' dependencies { - implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' implementation 'org.json:json:+' implementation 'com.owlike:genson:1.6' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' - testImplementation 'org.assertj:assertj-core:3.25.3' - testImplementation 'org.mockito:mockito-core:5.12.0' + testImplementation platform('org.junit:junit-bom:5.14.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.assertj:assertj-core:3.27.6' + testImplementation 'org.mockito:mockito-core:5.20.0' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } repositories { @@ -29,10 +30,8 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { @@ -75,12 +74,12 @@ test { } } -mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' - shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-basic/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-basic/chaincode-java/gradlew b/asset-transfer-basic/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-basic/chaincode-java/gradlew +++ b/asset-transfer-basic/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-basic/chaincode-java/gradlew.bat b/asset-transfer-basic/chaincode-java/gradlew.bat index 25da30db..c4bdd3ab 100644 --- a/asset-transfer-basic/chaincode-java/gradlew.bat +++ b/asset-transfer-basic/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/asset-transfer-events/application-gateway-java/build.gradle b/asset-transfer-events/application-gateway-java/build.gradle index c92dd4ad..7a2bb26a 100644 --- a/asset-transfer-events/application-gateway-java/build.gradle +++ b/asset-transfer-events/application-gateway-java/build.gradle @@ -16,10 +16,8 @@ dependencies { implementation 'com.google.code.gson:gson:2.11.0' } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { diff --git a/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-events/application-gateway-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-events/application-gateway-java/gradlew b/asset-transfer-events/application-gateway-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-events/application-gateway-java/gradlew +++ b/asset-transfer-events/application-gateway-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-events/application-gateway-java/gradlew.bat b/asset-transfer-events/application-gateway-java/gradlew.bat index 7101f8e4..e509b2dd 100644 --- a/asset-transfer-events/application-gateway-java/gradlew.bat +++ b/asset-transfer-events/application-gateway-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/asset-transfer-events/chaincode-java/build.gradle b/asset-transfer-events/chaincode-java/build.gradle index b04a0bff..d7f13cba 100644 --- a/asset-transfer-events/chaincode-java/build.gradle +++ b/asset-transfer-events/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -15,7 +15,6 @@ version '1.0-SNAPSHOT' dependencies { implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' implementation 'org.json:json:+' - testImplementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' } repositories { @@ -25,14 +24,12 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { - mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' + mainClass = 'org.hyperledger.fabric.contract.ContractRouter' } @@ -53,12 +50,12 @@ jacocoTestReport { dependsOn test } -mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' - shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-events/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-events/chaincode-java/gradlew b/asset-transfer-events/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-events/chaincode-java/gradlew +++ b/asset-transfer-events/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-events/chaincode-java/gradlew.bat b/asset-transfer-events/chaincode-java/gradlew.bat index 7101f8e4..e509b2dd 100644 --- a/asset-transfer-events/chaincode-java/gradlew.bat +++ b/asset-transfer-events/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/asset-transfer-ledger-queries/application-java/build.gradle b/asset-transfer-ledger-queries/application-java/build.gradle index a204249d..85fef27e 100644 --- a/asset-transfer-ledger-queries/application-java/build.gradle +++ b/asset-transfer-ledger-queries/application-java/build.gradle @@ -30,7 +30,7 @@ dependencies { application { // Define the main class for the application. - mainClassName = 'application.java.App' + mainClass = 'application.java.App' } // task for running the app after building dependencies @@ -39,4 +39,4 @@ task runApp(type: Exec) { group = "Execution" description = "Run the main class with ExecTask" commandLine "java", "-classpath", sourceSets.main.runtimeClasspath.getAsPath(), javaMainClass -} \ No newline at end of file +} diff --git a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-ledger-queries/application-java/gradlew b/asset-transfer-ledger-queries/application-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-ledger-queries/application-java/gradlew +++ b/asset-transfer-ledger-queries/application-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-ledger-queries/application-java/gradlew.bat b/asset-transfer-ledger-queries/application-java/gradlew.bat index 25da30db..c4bdd3ab 100644 --- a/asset-transfer-ledger-queries/application-java/gradlew.bat +++ b/asset-transfer-ledger-queries/application-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/asset-transfer-private-data/chaincode-java/build.gradle b/asset-transfer-private-data/chaincode-java/build.gradle index ec6a602c..18385899 100644 --- a/asset-transfer-private-data/chaincode-java/build.gradle +++ b/asset-transfer-private-data/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -17,9 +17,11 @@ dependencies { implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' implementation 'org.json:json:+' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' - testImplementation 'org.assertj:assertj-core:3.25.3' - testImplementation 'org.mockito:mockito-core:5.12.0' + testImplementation platform('org.junit:junit-bom:5.14.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testImplementation 'org.assertj:assertj-core:3.27.6' + testImplementation 'org.mockito:mockito-core:5.20.0' } repositories { @@ -29,10 +31,8 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { @@ -63,12 +63,12 @@ test { } } -mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' - shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-private-data/chaincode-java/gradlew b/asset-transfer-private-data/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-private-data/chaincode-java/gradlew +++ b/asset-transfer-private-data/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-private-data/chaincode-java/gradlew.bat b/asset-transfer-private-data/chaincode-java/gradlew.bat index 25da30db..c4bdd3ab 100644 --- a/asset-transfer-private-data/chaincode-java/gradlew.bat +++ b/asset-transfer-private-data/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/asset-transfer-sbe/chaincode-java/build.gradle b/asset-transfer-sbe/chaincode-java/build.gradle index a788dfc4..af61d69d 100644 --- a/asset-transfer-sbe/chaincode-java/build.gradle +++ b/asset-transfer-sbe/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -25,10 +25,8 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { @@ -75,6 +73,8 @@ shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/asset-transfer-sbe/chaincode-java/gradlew b/asset-transfer-sbe/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/asset-transfer-sbe/chaincode-java/gradlew +++ b/asset-transfer-sbe/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/asset-transfer-sbe/chaincode-java/gradlew.bat b/asset-transfer-sbe/chaincode-java/gradlew.bat index 25da30db..c4bdd3ab 100644 --- a/asset-transfer-sbe/chaincode-java/gradlew.bat +++ b/asset-transfer-sbe/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/high-throughput/startFabric.sh b/high-throughput/startFabric.sh index 06892e70..a32c9cdc 100755 --- a/high-throughput/startFabric.sh +++ b/high-throughput/startFabric.sh @@ -19,7 +19,7 @@ pushd ../test-network echo "Bring up test network" ./network.sh up createChannel -ca -./network.sh deployCC -ccn bigdatacc -ccp ../high-throughput/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cci Init +./network.sh deployCC -ccn bigdatacc -ccp ../high-throughput/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" popd cat < /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/off_chain_data/application-java/gradlew.bat b/off_chain_data/application-java/gradlew.bat index 7101f8e4..e509b2dd 100644 --- a/off_chain_data/application-java/gradlew.bat +++ b/off_chain_data/application-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/token-erc-20/chaincode-java/Dockerfile b/token-erc-20/chaincode-java/Dockerfile index 55aa22ba..d00acdea 100755 --- a/token-erc-20/chaincode-java/Dockerfile +++ b/token-erc-20/chaincode-java/Dockerfile @@ -1,31 +1,31 @@ # SPDX-License-Identifier: Apache-2.0 -# the first stage -FROM gradle:jdk11 AS GRADLE_BUILD +# the first stage +FROM gradle:9-jdk25 AS gradle_build # copy the build.gradle and src code to the container COPY src/ src/ -COPY build.gradle ./ +COPY build.gradle ./ # Build and package our code RUN gradle --no-daemon build shadowJar -x checkstyleMain -x checkstyleTest # the second stage of our build just needs the compiled files -FROM openjdk:11-jre +FROM eclipse-temurin:25-jre ARG CC_SERVER_PORT=9999 # Setup tini to work better handle signals -ENV TINI_VERSION v0.19.0 +ENV TINI_VERSION=v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini RUN addgroup --system javauser && useradd -g javauser javauser # copy only the artifacts we need from the first stage and discard the rest -COPY --chown=javauser:javauser --from=GRADLE_BUILD /home/gradle/build/libs/chaincode.jar /chaincode.jar -COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh +COPY --chown=javauser:javauser --from=gradle_build /home/gradle/build/libs/chaincode.jar /chaincode.jar +COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh -ENV PORT $CC_SERVER_PORT +ENV PORT=$CC_SERVER_PORT EXPOSE $CC_SERVER_PORT USER javauser diff --git a/token-erc-20/chaincode-java/build.gradle b/token-erc-20/chaincode-java/build.gradle index d3f3ce90..bc19e34a 100755 --- a/token-erc-20/chaincode-java/build.gradle +++ b/token-erc-20/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -17,10 +17,11 @@ dependencies { implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' implementation 'org.json:json:+' implementation 'com.owlike:genson:1.6' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' - testImplementation 'org.assertj:assertj-core:3.25.3' - testImplementation 'org.mockito:mockito-core:5.12.0' - testRuntimeOnly("net.bytebuddy:byte-buddy:1.10.6") + testImplementation platform('org.junit:junit-bom:5.14.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.assertj:assertj-core:3.27.6' + testImplementation 'org.mockito:mockito-core:5.20.0' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } @@ -31,10 +32,8 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { @@ -77,12 +76,12 @@ test { } } -mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' - shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100755 Binary files a/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100755 --- a/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/token-erc-20/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/token-erc-20/chaincode-java/gradlew b/token-erc-20/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/token-erc-20/chaincode-java/gradlew +++ b/token-erc-20/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/token-erc-20/chaincode-java/gradlew.bat b/token-erc-20/chaincode-java/gradlew.bat index 7101f8e4..e509b2dd 100755 --- a/token-erc-20/chaincode-java/gradlew.bat +++ b/token-erc-20/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/token-erc-721/chaincode-java/Dockerfile b/token-erc-721/chaincode-java/Dockerfile index e5992148..1647bbda 100755 --- a/token-erc-721/chaincode-java/Dockerfile +++ b/token-erc-721/chaincode-java/Dockerfile @@ -1,29 +1,29 @@ -# the first stage -FROM gradle:jdk11 AS GRADLE_BUILD +# the first stage +FROM gradle:9-jdk25 AS gradle_build # copy the build.gradle and src code to the container COPY src/ src/ -COPY build.gradle ./ +COPY build.gradle ./ # Build and package our code RUN gradle --no-daemon build shadowJar -x checkstyleMain -x checkstyleTest # the second stage of our build just needs the compiled files -FROM openjdk:11-jre +FROM eclipse-temurin:25-jre ARG CC_SERVER_PORT=9999 # Setup tini to work better handle signals -ENV TINI_VERSION v0.19.0 +ENV TINI_VERSION=v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini RUN addgroup --system javauser && useradd -g javauser javauser # copy only the artifacts we need from the first stage and discard the rest -COPY --chown=javauser:javauser --from=GRADLE_BUILD /home/gradle/build/libs/chaincode.jar /chaincode.jar -COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh +COPY --chown=javauser:javauser --from=gradle_build /home/gradle/build/libs/chaincode.jar /chaincode.jar +COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh -ENV PORT $CC_SERVER_PORT +ENV PORT=$CC_SERVER_PORT EXPOSE $CC_SERVER_PORT USER javauser diff --git a/token-erc-721/chaincode-java/build.gradle b/token-erc-721/chaincode-java/build.gradle index 07fefd5f..90e3581d 100755 --- a/token-erc-721/chaincode-java/build.gradle +++ b/token-erc-721/chaincode-java/build.gradle @@ -3,7 +3,7 @@ */ plugins { - id 'com.gradleup.shadow' version '8.3.5' + id 'com.gradleup.shadow' version '9.2.2' id 'application' id 'checkstyle' id 'jacoco' @@ -17,10 +17,11 @@ dependencies { implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+' implementation 'org.json:json:+' implementation 'com.owlike:genson:1.6' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' - testImplementation 'org.assertj:assertj-core:3.25.3' - testImplementation 'org.mockito:mockito-core:5.12.0' - testRuntimeOnly("net.bytebuddy:byte-buddy:1.10.6") + testImplementation platform('org.junit:junit-bom:5.14.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.assertj:assertj-core:3.27.6' + testImplementation 'org.mockito:mockito-core:5.20.0' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } @@ -31,10 +32,8 @@ repositories { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } +compileJava { + options.release = 11 } application { @@ -80,12 +79,12 @@ test { } } -mainClassName = 'org.hyperledger.fabric.contract.ContractRouter' - shadowJar { archiveBaseName = 'chaincode' archiveVersion = '' archiveClassifier = '' + + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() manifest { diff --git a/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.jar index d64cd491..8bdaf60c 100644 Binary files a/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.jar and b/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.properties index e2847c82..2e111328 100644 --- a/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.properties +++ b/token-erc-721/chaincode-java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/token-erc-721/chaincode-java/gradlew b/token-erc-721/chaincode-java/gradlew index 1aa94a42..adff685a 100755 --- a/token-erc-721/chaincode-java/gradlew +++ b/token-erc-721/chaincode-java/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/token-erc-721/chaincode-java/gradlew.bat b/token-erc-721/chaincode-java/gradlew.bat index 7101f8e4..e509b2dd 100755 --- a/token-erc-721/chaincode-java/gradlew.bat +++ b/token-erc-721/chaincode-java/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 ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell