fabric-samples/asset-transfer-private-data/chaincode-java/build.gradle
Mark S. Lewis 36926e2801
Support Java 25
- Update Gradle to 9.1.0.
- Update shadow plugin to 9.2.2.
- Requires a minimum of Java 17 to run Gradle.
- Chaincode and applications still target Java 11.
- Use release option instead of Gradle toolchain since the toolchain
  download can cause issues when building Docker images.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2025-10-06 12:05:54 +01:00

79 lines
1.5 KiB
Groovy

/*
* SPDX-License-Identifier: Apache-2.0
*/
plugins {
id 'com.gradleup.shadow' version '9.2.2'
id 'application'
id 'checkstyle'
id 'jacoco'
}
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:+'
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 {
mavenCentral()
maven {
url 'https://jitpack.io'
}
}
compileJava {
options.release = 11
}
application {
mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
}
checkstyle {
toolVersion '8.21'
configFile file("config/checkstyle/checkstyle.xml")
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
jacocoTestReport {
dependsOn test
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
shadowJar {
archiveBaseName = 'chaincode'
archiveVersion = ''
archiveClassifier = ''
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
manifest {
attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
}
}
installDist.dependsOn check