diff --git a/build.gradle b/build.gradle index c3a0584c..947cabf6 100644 --- a/build.gradle +++ b/build.gradle @@ -37,23 +37,25 @@ subprojects { group = 'org.hyperledger.fabric-chaincode-java' version = rootProject.version - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + } + } dependencies { - implementation group: 'commons-cli', name: 'commons-cli', version: '1.6.0' - implementation group: 'commons-logging', name: 'commons-logging', version: '1.2' - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.1' - testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.1' + implementation 'commons-cli:commons-cli:1.6.0' + implementation 'commons-logging:commons-logging:1.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.0' - testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: 'system-rules-1.17.0' + testImplementation 'org.hamcrest:hamcrest-library:1.3' + testImplementation 'org.mockito:mockito-core:2.23.0' + testImplementation 'com.github.stefanbirkner:system-rules:system-rules-1.17.0' - testCompileOnly group: 'junit', name: 'junit', version: '4.12' - testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.3.1' - testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1' + testCompileOnly 'junit:junit:4.12' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' + testImplementation 'org.assertj:assertj-core:3.9.1' } test { diff --git a/examples/fabric-contract-example-as-service/build.gradle b/examples/fabric-contract-example-as-service/build.gradle index 7c709153..9d72feb4 100644 --- a/examples/fabric-contract-example-as-service/build.gradle +++ b/examples/fabric-contract-example-as-service/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } @@ -8,7 +8,6 @@ version '0.0.1' sourceCompatibility = 1.8 repositories { - mavenLocal() mavenCentral() maven { url "https://www.jitpack.io" @@ -20,7 +19,7 @@ repositories { } dependencies { - compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.3.+' + compile group: 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1' compile 'org.json:json:20231013' testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' testImplementation 'org.assertj:assertj-core:3.11.1' @@ -28,9 +27,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/examples/fabric-contract-example-gradle-kotlin/build.gradle.kts b/examples/fabric-contract-example-gradle-kotlin/build.gradle.kts index 45d20f3e..5b7ce709 100644 --- a/examples/fabric-contract-example-gradle-kotlin/build.gradle.kts +++ b/examples/fabric-contract-example-gradle-kotlin/build.gradle.kts @@ -5,7 +5,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" + id("com.github.johnrengelman.shadow") version "8.1.1" id("org.jetbrains.kotlin.jvm") version "1.3.41" } @@ -28,7 +28,6 @@ dependencies { } repositories { - mavenLocal() mavenCentral() jcenter() maven { diff --git a/examples/fabric-contract-example-gradle/build.gradle b/examples/fabric-contract-example-gradle/build.gradle index 1389be1a..2779e6b2 100644 --- a/examples/fabric-contract-example-gradle/build.gradle +++ b/examples/fabric-contract-example-gradle/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } @@ -8,7 +8,6 @@ version '0.0.1' sourceCompatibility = 1.8 repositories { - mavenLocal() mavenCentral() maven { url "https://www.jitpack.io" @@ -20,7 +19,7 @@ repositories { } dependencies { - compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.5.1' + compile group: 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1' compile 'org.json:json:20231013' testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' testImplementation 'org.assertj:assertj-core:3.11.1' @@ -28,9 +27,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/examples/ledger-api/build.gradle b/examples/ledger-api/build.gradle index 278cb2b5..2779e6b2 100644 --- a/examples/ledger-api/build.gradle +++ b/examples/ledger-api/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } @@ -8,7 +8,6 @@ version '0.0.1' sourceCompatibility = 1.8 repositories { - mavenLocal() mavenCentral() maven { url "https://www.jitpack.io" @@ -20,7 +19,7 @@ repositories { } dependencies { - compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '1.4.5' + compile group: 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.1' compile 'org.json:json:20231013' testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' testImplementation 'org.assertj:assertj-core:3.11.1' @@ -28,9 +27,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/fabric-chaincode-integration-test/src/contracts/bare-gradle/build.gradle b/fabric-chaincode-integration-test/src/contracts/bare-gradle/build.gradle index d1a04496..200ae1cd 100644 --- a/fabric-chaincode-integration-test/src/contracts/bare-gradle/build.gradle +++ b/fabric-chaincode-integration-test/src/contracts/bare-gradle/build.gradle @@ -1,15 +1,18 @@ plugins { - id 'com.github.johnrengelman.shadow' version '5.2.0' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } group 'org.hyperledger.fabric-chaincode-java' version '1.0-SNAPSHOT' -sourceCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} repositories { - mavenLocal() mavenCentral() maven { url = "https://www.jitpack.io" } maven { @@ -23,9 +26,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/fabric-chaincode-integration-test/src/contracts/bare-maven/pom.xml b/fabric-chaincode-integration-test/src/contracts/bare-maven/pom.xml index 51e9df37..a3a6bebe 100644 --- a/fabric-chaincode-integration-test/src/contracts/bare-maven/pom.xml +++ b/fabric-chaincode-integration-test/src/contracts/bare-maven/pom.xml @@ -7,7 +7,7 @@ - 1.8 + 8 UTF-8 UTF-8 @@ -49,8 +49,7 @@ maven-compiler-plugin 3.11.0 - ${java.version} - ${java.version} + ${java.version} diff --git a/fabric-chaincode-integration-test/src/contracts/fabric-ledger-api/build.gradle b/fabric-chaincode-integration-test/src/contracts/fabric-ledger-api/build.gradle index 8762d6bd..200ae1cd 100644 --- a/fabric-chaincode-integration-test/src/contracts/fabric-ledger-api/build.gradle +++ b/fabric-chaincode-integration-test/src/contracts/fabric-ledger-api/build.gradle @@ -1,15 +1,18 @@ plugins { - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } group 'org.hyperledger.fabric-chaincode-java' version '1.0-SNAPSHOT' -sourceCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} repositories { - mavenLocal() mavenCentral() maven { url = "https://www.jitpack.io" } maven { @@ -23,9 +26,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/fabric-chaincode-integration-test/src/contracts/fabric-shim-api/build.gradle b/fabric-chaincode-integration-test/src/contracts/fabric-shim-api/build.gradle index fa796caf..1a3b4661 100644 --- a/fabric-chaincode-integration-test/src/contracts/fabric-shim-api/build.gradle +++ b/fabric-chaincode-integration-test/src/contracts/fabric-shim-api/build.gradle @@ -1,15 +1,18 @@ plugins { - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow:8.1.1' id 'java' } group 'org.hyperledger.fabric-chaincode-java' version '1.0-SNAPSHOT' -sourceCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} repositories { - mavenLocal() mavenCentral() maven { url = "https://www.jitpack.io" } maven { @@ -25,9 +28,9 @@ dependencies { } shadowJar { - baseName = 'chaincode' - version = null - classifier = null + archiveBaseName = 'chaincode' + archiveVersion = '' + archiveClassifier = '' mergeServiceFiles() manifest { diff --git a/fabric-chaincode-integration-test/src/contracts/wrapper-maven/pom.xml b/fabric-chaincode-integration-test/src/contracts/wrapper-maven/pom.xml index 069665ac..50082839 100644 --- a/fabric-chaincode-integration-test/src/contracts/wrapper-maven/pom.xml +++ b/fabric-chaincode-integration-test/src/contracts/wrapper-maven/pom.xml @@ -7,7 +7,7 @@ - 1.8 + 8 UTF-8 UTF-8 @@ -49,8 +49,7 @@ maven-compiler-plugin 3.11.0 - ${java.version} - ${java.version} + ${java.version}