fabric-samples/asset-transfer-ledger-queries/chaincode-java/build.gradle
SurbhiAgarwal1 36545ecb6b Fix #1148: Support CouchDB index deployment for Java chaincode
- Update packageCC.sh to correctly copy META-INF to the distribution directory.
- Port asset-transfer-ledger-queries to Java to provide a sample with rich query support.
- Ensure all Java chaincodes use src/main/resources/META-INF for standard index placement.

Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
2026-04-16 05:37:44 +05:30

91 lines
1.8 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:+'
implementation 'com.owlike:genson:1.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'
}
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
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.9
}
}
}
finalizedBy jacocoTestReport
}
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'
}
}
check.dependsOn jacocoTestCoverageVerification
installDist.dependsOn check