Skip to content

Commit 67ad583

Browse files
Use Java 25 and Gradle 9
- Docker image includes Java 25 and Gradle 9. - Java 25 is used to compile and test. - Java 11 remains the minimum supported version. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 658983f commit 67ad583

File tree

11 files changed

+27
-35
lines changed

11 files changed

+27
-35
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2626
with:
2727
distribution: "temurin"
28-
java-version: 21
28+
java-version: 25
2929
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
3030
- name: Publish to GitHub Packages
3131
run: |
@@ -44,7 +44,7 @@ jobs:
4444
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
4545
with:
4646
distribution: "temurin"
47-
java-version: 21
47+
java-version: 25
4848
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
4949
- name: Publish to Maven Central
5050
run: |
@@ -75,7 +75,7 @@ jobs:
7575
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7676
with:
7777
distribution: "temurin"
78-
java-version: 21
78+
java-version: 25
7979
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
8080
- name: Build the dependencies needed for the image
8181
run: ./gradlew :fabric-chaincode-docker:copyAllDeps

.github/workflows/scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2828
with:
2929
distribution: temurin
30-
java-version: 21
31-
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
30+
java-version: 25
31+
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
3232
- name: Scan
3333
run: make scan

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2323
with:
2424
distribution: temurin
25-
java-version: 21
25+
java-version: 25
2626
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
2727
- name: Build and Unit test
2828
run: ./gradlew :fabric-chaincode-shim:build
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
3737
with:
3838
distribution: temurin
39-
java-version: 21
39+
java-version: 25
4040
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
4141
with:
4242
node-version: "lts/*"
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7373
with:
7474
distribution: temurin
75-
java-version: 21
75+
java-version: 25
7676
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
7777
- name: Build Docker image
7878
run: ./gradlew :fabric-chaincode-docker:buildImage

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ subprojects {
7878
spotless {
7979
java {
8080
removeUnusedImports()
81-
palantirJavaFormat('2.67.0').formatJavadoc(true)
81+
palantirJavaFormat().formatJavadoc(true)
8282
formatAnnotations()
8383
}
8484
}

fabric-chaincode-docker/Dockerfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
ARG JAVA_IMAGE=eclipse-temurin:21-jdk
1+
ARG JAVA_IMAGE=eclipse-temurin:25-jdk
22

33
FROM ${JAVA_IMAGE} AS builder
4-
ENV DEBIAN_FRONTEND=noninteractive
54

6-
# Build tools
75
RUN apt-get update \
8-
&& apt-get -y install zip unzip \
9-
&& apt-get clean \
10-
&& rm -rf /var/lib/apt/lists/*
6+
&& apt-get install -y curl zip unzip
117
RUN curl -s "https://get.sdkman.io" | bash
128

139
SHELL ["/bin/bash", "-c"]
1410

1511
RUN source /root/.sdkman/bin/sdkman-init.sh \
16-
&& sdk install gradle 8.14.3 \
12+
&& sdk install gradle 9.1.0 \
1713
&& sdk install maven 3.9.11
1814

1915
FROM ${JAVA_IMAGE} AS dependencies
2016

21-
COPY --from=builder /root/.sdkman/candidates/gradle/current /usr/bin/gradle
22-
COPY --from=builder /root/.sdkman/candidates/maven/current /usr/bin/maven
17+
COPY --from=builder /root/.sdkman/candidates/gradle/current /opt/gradle
18+
COPY --from=builder /root/.sdkman/candidates/maven/current /opt/maven
2319

2420
SHELL ["/bin/bash", "-c"]
25-
ENV PATH="/usr/bin/maven/bin:/usr/bin/maven/:/usr/bin/gradle:/usr/bin/gradle/bin:${PATH}"
21+
ENV PATH="/opt/maven/bin:/opt/gradle/bin:${PATH}"
2622

2723
# Coping libs, scripts and sources
28-
ADD build/distributions/ /root/
24+
COPY build/distributions/ /root/
2925

3026
#Creating folders structure
31-
RUN mkdir -p /root/chaincode-java/chaincode/src /root/chaincode-java/chaincode/build/out
27+
RUN mkdir -p \
28+
/root/chaincode-java/chaincode/src \
29+
/root/chaincode-java/chaincode/build/out \
30+
/root/chaincode-java/shim-src/fabric-chaincode-integration-test \
31+
/root/chaincode-java/shim-src/fabric-chaincode-docker
3232

3333
#Making scripts runnable
3434
RUN chmod +x /root/chaincode-java/start /root/chaincode-java/build.sh
@@ -51,15 +51,15 @@ WORKDIR /root/chaincode-java
5151
#Gradle doesn't run without settings.gradle file, so create one
5252
RUN touch settings.gradle \
5353
&& gradle wrapper \
54-
&& ./gradlew --version \
54+
&& ./gradlew wrapper \
5555
&& mvn -N wrapper:wrapper
5656

5757
# Creating final javaenv image which will include all required
5858
# dependencies to build and compile java chaincode
5959
FROM ${JAVA_IMAGE}
6060

6161
RUN apt-get update \
62-
&& apt-get -y install zip unzip \
62+
&& apt-get install -y zip unzip \
6363
&& apt-get clean \
6464
&& rm -rf /var/lib/apt/lists/* \
6565
&& mkdir -p /chaincode/input \

fabric-chaincode-docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ tasks.register('copyAllDeps', Copy) {
5959
tasks.register('buildImage', DockerBuildImage) {
6060
dependsOn copyAllDeps
6161
inputDir = project.file('Dockerfile').parentFile
62-
images = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:2.5', 'hyperledger/fabric-javaenv:amd64-2.5.8', 'hyperledger/fabric-javaenv:amd64-latest']
62+
images = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:2.5', 'hyperledger/fabric-javaenv:2.5.8']
6363
}

fabric-chaincode-shim/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ sourceSets {
7878

7979
}
8080

81-
jacoco {
82-
toolVersion = "0.8.12"
83-
}
84-
8581
jacocoTestReport {
8682
afterEvaluate {
8783
classDirectories.from = files(classDirectories.files.collect {

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH="\\\"\\\""
118117

119118

120119
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172171
# For Cygwin or MSYS, switch paths to Windows format before running java
173172
if "$cygwin" || "$msys" ; then
174173
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176174

177175
JAVACMD=$( cygpath --unix "$JAVACMD" )
178176

@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212210

213211
set -- \
214212
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215-
-classpath "$CLASSPATH" \
216213
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217214
"$@"
218215

0 commit comments

Comments
 (0)