Skip to content

Commit 7a224a7

Browse files
Update dependencies
- Update Gradle and Maven build tools in Docker image to latest versions. - Update project dependencies, including fabric-protos, which now requires protobuf-java v4 instead of v3. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 826f077 commit 7a224a7

File tree

17 files changed

+68
-74
lines changed

17 files changed

+68
-74
lines changed

build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66

77
plugins {
8-
id "com.github.ben-manes.versions" version "0.51.0"
9-
id "com.diffplug.spotless" version "6.25.0"
8+
id "com.github.ben-manes.versions" version "0.52.0"
9+
id "com.diffplug.spotless" version "7.0.4"
1010
}
1111

1212
version = '2.5.6'
@@ -36,7 +36,7 @@ allprojects {
3636
format 'misc', {
3737
target '*.gradle', '.gitattributes', '.gitignore'
3838
trimTrailingWhitespace()
39-
indentWithSpaces()
39+
leadingTabsToSpaces()
4040
endWithNewline()
4141
}
4242
}
@@ -62,14 +62,14 @@ subprojects {
6262

6363
dependencies {
6464
implementation 'commons-cli:commons-cli:1.9.0'
65-
implementation 'commons-logging:commons-logging:1.3.4'
65+
implementation 'commons-logging:commons-logging:1.3.5'
6666

67-
testImplementation platform('org.junit:junit-bom:5.11.3')
67+
testImplementation platform('org.junit:junit-bom:5.13.1')
6868
testImplementation 'org.junit.jupiter:junit-jupiter'
6969
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
70-
testImplementation 'org.assertj:assertj-core:3.26.3'
71-
testImplementation 'org.mockito:mockito-core:5.14.2'
72-
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.1.7'
70+
testImplementation 'org.assertj:assertj-core:3.27.3'
71+
testImplementation 'org.mockito:mockito-core:5.18.0'
72+
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.1.8'
7373

7474
testImplementation 'org.hamcrest:hamcrest-library:3.0'
7575
}
@@ -81,7 +81,7 @@ subprojects {
8181
spotless {
8282
java {
8383
removeUnusedImports()
84-
palantirJavaFormat('2.50.0').formatJavadoc(true)
84+
palantirJavaFormat('2.67.0').formatJavadoc(true)
8585
formatAnnotations()
8686
}
8787
}

examples/fabric-contract-example-as-service/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Example multi-stage dockerfile for Java Chaincode
55

66
# the first stage
7-
FROM gradle:jdk11 AS GRADLE_BUILD
7+
FROM gradle:jdk21 AS GRADLE_BUILD
88

99
# copy the build.gradle and src code to the container
1010
COPY src/ src/
@@ -15,7 +15,7 @@ RUN gradle build shadowJar
1515

1616

1717
# the second stage of our build just needs the compiled files
18-
FROM openjdk:11-jre-slim
18+
FROM openjdk:21-jre-slim
1919
# copy only the artifacts we need from the first stage and discard the rest
2020
COPY --from=GRADLE_BUILD /home/gradle/build/libs/chaincode.jar /chaincode.jar
2121

examples/fabric-contract-example-as-service/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ repositories {
2222

2323
dependencies {
2424
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.2'
25-
compile 'org.json:json:20240303'
26-
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
27-
testImplementation 'org.assertj:assertj-core:3.26.3'
28-
testImplementation 'org.mockito:mockito-core:5.13.0'
25+
compile 'org.json:json:20250517'
26+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.1'
27+
testImplementation 'org.assertj:assertj-core:3.27.3'
28+
testImplementation 'org.mockito:mockito-core:5.18.0'
2929
}
3030

3131
shadowJar {

examples/fabric-contract-example-gradle-kotlin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ version = "0.0.1"
1515

1616
dependencies {
1717
implementation("org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.2")
18-
implementation("org.json:json:20240303")
18+
implementation("org.json:json:20250517")
1919
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
2020

21-
testImplementation("org.junit.jupiter:junit-jupiter:5.11.0")
21+
testImplementation("org.junit.jupiter:junit-jupiter:5.13.1")
2222
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
2323
}
2424

examples/fabric-contract-example-gradle/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ repositories {
2222

2323
dependencies {
2424
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.2'
25-
compile 'org.json:json:20240303'
26-
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
27-
testImplementation 'org.assertj:assertj-core:3.26.3'
28-
testImplementation 'org.mockito:mockito-core:5.13.0'
25+
compile 'org.json:json:20250517'
26+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.1'
27+
testImplementation 'org.assertj:assertj-core:3.27.3'
28+
testImplementation 'org.mockito:mockito-core:5.18.0'
2929
}
3030

3131
shadowJar {

examples/fabric-contract-example-maven/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<slf4j.version>1.7.5</slf4j.version>
2020

2121
<!-- Test -->
22-
<junit.jupiter.version>5.3.0-RC1</junit.jupiter.version>
23-
<junit.platform.version>1.3.0-RC1</junit.platform.version>
22+
<junit.jupiter.version>5.13.1</junit.jupiter.version>
23+
<junit.platform.version>1.13.1</junit.platform.version>
2424

2525
</properties>
2626

@@ -48,7 +48,7 @@
4848
<dependency>
4949
<groupId>org.hyperledger.fabric</groupId>
5050
<artifactId>fabric-protos</artifactId>
51-
<version>0.3.3</version>
51+
<version>0.3.7</version>
5252
<scope>compile</scope>
5353
</dependency>
5454

@@ -92,7 +92,7 @@
9292
<dependency>
9393
<groupId>org.mockito</groupId>
9494
<artifactId>mockito-core</artifactId>
95-
<version>2.10.0</version>
95+
<version>5.18.0</version>
9696
</dependency>
9797

9898
<!-- https://mvnrepository.com/artifact/org.json/json -->

examples/ledger-api/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ repositories {
2121
}
2222

2323
dependencies {
24-
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.2'
25-
compile 'org.json:json:20240303'
26-
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
27-
testImplementation 'org.assertj:assertj-core:3.26.3'
28-
testImplementation 'org.mockito:mockito-core:5.13.0'
24+
compile 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.5'
25+
compile 'org.json:json:20250517'
26+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.1'
27+
testImplementation 'org.assertj:assertj-core:3.27.3'
28+
testImplementation 'org.mockito:mockito-core:5.18.0'
2929
}
3030

3131
shadowJar {

fabric-chaincode-docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ RUN curl -s "https://get.sdkman.io" | bash
1313
SHELL ["/bin/bash", "-c"]
1414

1515
RUN source /root/.sdkman/bin/sdkman-init.sh \
16-
&& sdk install gradle 8.11.1 \
17-
&& sdk install maven 3.9.9
16+
&& sdk install gradle 8.14.2 \
17+
&& sdk install maven 3.9.10
1818

1919
FROM ${JAVA_IMAGE} AS dependencies
2020

fabric-chaincode-docker/build.gradle

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,43 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
buildscript {
8-
repositories {
9-
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
10-
maven { url "https://www.jitpack.io" }
11-
mavenCentral()
12-
gradlePluginPortal()
13-
}
14-
dependencies {
15-
classpath 'com.bmuschko:gradle-docker-plugin:9.4.0'
16-
}
7+
plugins {
8+
id 'com.bmuschko.docker-remote-api' version '9.4.0'
179
}
1810

19-
apply plugin: 'com.bmuschko.docker-remote-api'
11+
repositories {
12+
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
13+
maven { url "https://www.jitpack.io" }
14+
mavenCentral()
15+
}
2016

2117
import com.bmuschko.gradle.docker.tasks.image.*
2218

23-
task copyLib (type: Copy) {
19+
tasks.register('copyLib', Copy) {
2420
dependsOn ':fabric-chaincode-shim:build'
2521
from project(':fabric-chaincode-shim').configurations.runtimeClasspath
2622
into('build/distributions/chaincode-java/lib')
2723
}
2824

29-
task copyShimJar(type: Copy) {
25+
tasks.register('copyShimJar', Copy) {
3026
dependsOn copyLib
3127
from project(':fabric-chaincode-shim').jar
3228
into('build/distributions/chaincode-java/lib')
3329
}
3430

35-
task copyStartScript(type: Copy) {
31+
tasks.register('copyStartScript', Copy) {
3632
dependsOn copyShimJar
37-
from ('start')
38-
into ('build/distributions/chaincode-java')
33+
from('start')
34+
into('build/distributions/chaincode-java')
3935
}
4036

41-
task copyBuildScript(type: Copy) {
37+
tasks.register('copyBuildScript', Copy) {
4238
dependsOn copyStartScript
43-
from ('build.sh')
44-
into ('build/distributions/chaincode-java')
39+
from('build.sh')
40+
into('build/distributions/chaincode-java')
4541
}
4642

47-
task copyAllDeps(type: Copy) {
43+
tasks.register('copyAllDeps', Copy) {
4844
dependsOn copyBuildScript
4945
copy {
5046
from project(':fabric-chaincode-shim').getProjectDir()
@@ -62,7 +58,7 @@ task copyAllDeps(type: Copy) {
6258
}
6359
}
6460

65-
task buildImage(type: DockerBuildImage) {
61+
tasks.register('buildImage', DockerBuildImage) {
6662
dependsOn copyAllDeps
6763
inputDir = project.file('Dockerfile').parentFile
6864
images = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:2.5', 'hyperledger/fabric-javaenv:amd64-2.5.6', 'hyperledger/fabric-javaenv:amd64-latest']

fabric-chaincode-integration-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies {
22
implementation project(':fabric-chaincode-docker')
33
implementation project(':fabric-chaincode-shim')
4-
implementation 'org.json:json:20240303'
4+
implementation 'org.json:json:20250517'
55
}
66

77

0 commit comments

Comments
 (0)