()
sourceSets.forEach {
sourceSet ->
- sourceSet.allSource.findAll { !it.path.contains("build") && !(it.path.contains("test") && it.path.contains("resources"))}.each {
+ sourceSet.allSource.findAll {
+ !it.path.contains("build") &&
+ !(it.path.contains("test") && it.path.contains("resources"))
+ }.each {
file ->
- if (!file.name.contains("json")){
- BufferedReader r = new BufferedReader(new FileReader(file))
- def line, hasSPDX = false, hasTraditional = false
- while ((line = r.readLine()) != null) {
- if (line.contains("SPDX-License-Identifier")) {
- hasSPDX = true
- break
- }
- if (line.contains("http://www.apache.org/licenses/LICENSE-2.0")) {
- hasTraditional = true
- break
+ if (!file.name.contains("json")) {
+ BufferedReader r = new BufferedReader(new FileReader(file))
+ def line, hasSPDX = false, hasTraditional = false
+ while ((line = r.readLine()) != null) {
+ if (line.contains("SPDX-License-Identifier")) {
+ hasSPDX = true
+ break
+ }
+ if (line.contains("http://www.apache.org/licenses/LICENSE-2.0")) {
+ hasTraditional = true
+ break
+ }
}
- }
- if (!hasSPDX) {
- if (hasTraditional) {
- noSPDX.add(file)
- } else {
- missing.add(file)
+ if (!hasSPDX) {
+ if (hasTraditional) {
+ noSPDX.add(file)
+ } else {
+ missing.add(file)
+ }
}
}
- }
}
}
if (noSPDX.isEmpty()) {
- println "All remaining files have Apache 2.0 headers"
+ println "All remaining files have Apache 2.0 headers."
} else {
println "We are standardizing with the SPDX style license headers."
println "The following files contain the traditional license headers which are still valid:"
@@ -212,21 +215,17 @@ javadoc {
classpath = sourceSets.main.runtimeClasspath
- javadoc.options.addStringOption('Xdoclint:none', '-quiet')
+ options.addStringOption('Xdoclint:none', '-quiet')
+ options.addStringOption('Xwerror', '-quiet')
options.overview = "src/main/java/org/hyperledger/fabric/overview.html"
-}
-if (JavaVersion.current().isJava8Compatible()) {
- project.tasks.withType(Javadoc) {
- options.addStringOption('Xdoclint:all', '-quiet')
- options.addStringOption('Xwerror', '-quiet')
- }
}
+def final stagingDeployUrl = layout.buildDirectory.dir('staging-deploy')
publishing {
- publications {
- shim(MavenPublication) {
+ publications {
+ shim(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
@@ -235,10 +234,12 @@ publishing {
name = 'JavaChaincodeShim'
packaging = 'jar'
description = 'Hyperledger Fabric Java Chaincode Shim'
- url = 'http://www.hyperledger.org/'
+ url = 'https://hyperledger.github.io/fabric-chaincode-java/'
scm {
- url = 'https://github.com/hyperledger/fabric-chaincode-java.git'
+ connection = 'scm:git:https://github.com/hyperledger/fabric-chaincode-java.git'
+ developerConnection = 'scm:git:ssh://github.com:hyperledger/fabric-chaincode-java.git'
+ url = 'https://github.com/hyperledger/fabric-chaincode-java'
}
licenses {
license {
@@ -248,45 +249,24 @@ publishing {
}
developers {
- developer {
- id = 'gennadylaventman'
- name = 'Gennady Laventman'
- email = 'gennady@il.ibm.com'
- }
- developer {
- id = 'luiss'
- name = 'Luis Sanchez'
- email = 'luiss@me.com'
- }
- developer {
- id = 'C0rWin'
- name = 'Artem Barger'
- email = 'bartem@il.ibm.com'
- }
developer {
id = 'denyeart'
name = 'David Enyeart'
email = 'enyeart@us.ibm.com'
}
+ developer {
+ id = 'bestbeforetoday'
+ name = 'Mark S. Lewis'
+ email = 'Mark.S.Lewis@outlook.com'
+ }
}
}
- }
-
- }
-
- repositories {
- maven {
- name = "release"
- url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
- credentials {
- username = project.findProperty('ossrhUsername')
- password = project.findProperty('ossrhPassword')
- }
-
}
+ }
+ repositories {
maven {
- name = "GitHubPackages"
+ name = "GitHub"
url = "https://maven.pkg.github.com/hyperledger/fabric-chaincode-java"
credentials {
username = System.getenv("GITHUB_ACTOR")
@@ -297,25 +277,24 @@ publishing {
}
signing {
- println "Signing"
- if (project.findProperty('signing.key')) {
- def signingKey = project.findProperty('signing.key')
- def signingPassword = project.findProperty('signing.password')
- useInMemoryPgpKeys(signingKey, signingPassword)
-
- sign publishing.publications.shim
- println "... signed"
- } else {
- println "... no keys to use "
+ def signingKey = findProperty('signingKey')
+ def signingPassword = findProperty('signingPassword')
+ useInMemoryPgpKeys(signingKey, signingPassword)
+
+ required = {
+ gradle.taskGraph.hasTask(":${project.name}:publishShimPublicationToNmcpRepository")
+ || gradle.taskGraph.hasTask(":${project.name}:publishShimPublicationToGitHubRepository")
}
+
+ sign publishing.publications.shim
}
// Need to specify the sourcesJar task BEFORE the java{withSourcesJar()} so that it picks up the duplicatesStratergy
// otherwise this fails with a duplicates error.
// (see https://github.com/gradle/gradle/issues/17236)
-task sourcesJar(type: Jar) {
- duplicatesStrategy = 'include'
+tasks.register('sourcesJar', Jar) {
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
@@ -332,16 +311,16 @@ build.dependsOn licenseCheck
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
-tasks.withType(Test) {
+tasks.withType(Test).configureEach {
environment "CORE_PEER_LOCALMSPID", "mymsp"
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
- TestLogEvent.PASSED,
- TestLogEvent.SKIPPED,
- TestLogEvent.STANDARD_OUT
+ TestLogEvent.PASSED,
+ TestLogEvent.SKIPPED,
+ TestLogEvent.STANDARD_OUT
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
@@ -350,22 +329,23 @@ tasks.withType(Test) {
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
- TestLogEvent.FAILED,
- TestLogEvent.PASSED,
- TestLogEvent.SKIPPED,
- TestLogEvent.STANDARD_ERROR,
- TestLogEvent.STANDARD_OUT
+ TestLogEvent.FAILED,
+ TestLogEvent.PASSED,
+ TestLogEvent.SKIPPED,
+ TestLogEvent.STANDARD_ERROR,
+ TestLogEvent.STANDARD_OUT
exceptionFormat = TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
- afterSuite { desc, result ->
+ afterSuite {desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
- println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
+ println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' +
+ ('-' * repeatLength))
}
}
}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java
index 35720635b..4e8a6e4a3 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/Logger.java
@@ -14,11 +14,15 @@
/** Logger class to use throughout the Contract Implementation. */
public class Logger extends java.util.logging.Logger {
+ /**
+ * Subclasses must ensure that a parent logger is set appropriately, for example:
+ *
+ * {@code logger.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric"))}
+ *
+ * @param name A name for the logger.
+ */
protected Logger(final String name) {
super(name, null);
-
- // ensure that the parent logger is set
- super.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric"));
}
/**
@@ -26,7 +30,9 @@ protected Logger(final String name) {
* @return Logger
*/
public static Logger getLogger(final String name) {
- return new Logger(name);
+ Logger result = new Logger(name);
+ result.setParent(java.util.logging.Logger.getLogger("org.hyperledger.fabric"));
+ return result;
}
/** @param msgSupplier */
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java
index d7b6f9e5d..f8a4232cb 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ContractRouter.java
@@ -102,7 +102,7 @@ void startRouting() {
}
}
- @SuppressWarnings("PMD.AvoidCatchingThrowable")
+ @SuppressWarnings("PMD.AvoidCatchingGenericException")
private Response processRequest(final ChaincodeStub stub) {
LOGGER.info(() -> "Got invoke routing request");
try {
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java
index ac2e33b99..c6dd1b927 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/execution/JSONTransactionSerializer.java
@@ -26,7 +26,12 @@
/** Used as the default serialisation for transmission from SDK to Contract. */
@Serializer()
-@SuppressWarnings({"PMD.GodClass", "PMD.AvoidLiteralsInIfCondition", "PMD.AvoidDuplicateLiterals"})
+@SuppressWarnings({
+ "PMD.GodClass",
+ "PMD.AvoidLiteralsInIfCondition",
+ "PMD.AvoidDuplicateLiterals",
+ "PMD.AvoidDeeplyNestedIfStmts"
+})
public class JSONTransactionSerializer implements SerializerInterface {
private static final Logger LOGGER = Logger.getLogger(JSONTransactionSerializer.class.getName());
private final TypeRegistry typeRegistry = TypeRegistry.getRegistry();
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/SerializerRegistryImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/SerializerRegistryImpl.java
index 99a41e03d..ecd406e88 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/SerializerRegistryImpl.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/routing/impl/SerializerRegistryImpl.java
@@ -8,6 +8,7 @@
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ClassInfo;
import io.github.classgraph.ScanResult;
+import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -41,15 +42,20 @@ public SerializerInterface getSerializer(final String name, final Serializer.TAR
return contents.get(key);
}
- private SerializerInterface add(
- final String name, final Serializer.TARGET target, final Class clazz)
+ private void add(final String name, final Serializer.TARGET target, final Class> clazz)
throws InstantiationException, IllegalAccessException {
LOGGER.debug(() -> "Adding new Class " + clazz.getCanonicalName() + " for " + target);
final String key = name + ":" + target;
- final SerializerInterface newObj = clazz.newInstance();
- this.contents.put(key, newObj);
-
- return newObj;
+ try {
+ final SerializerInterface newObj =
+ (SerializerInterface) clazz.getDeclaredConstructor().newInstance();
+ this.contents.put(key, newObj);
+ } catch (InvocationTargetException | NoSuchMethodException e) {
+ InstantiationException wrapper = new InstantiationException(
+ "Exception constructing " + clazz.getCanonicalName() + ": " + e.getMessage());
+ wrapper.addSuppressed(e);
+ throw wrapper;
+ }
}
/**
@@ -67,10 +73,10 @@ public void findAndSetContents() throws InstantiationException, IllegalAccessExc
final Set seenClass = new HashSet<>();
try (ScanResult scanResult = classGraph.scan()) {
- for (final ClassInfo classInfo :
- scanResult.getClassesWithAnnotation(this.ANNOTATION_CLASS.getCanonicalName())) {
+ for (final ClassInfo classInfo : scanResult.getClassesWithAnnotation(ANNOTATION_CLASS.getCanonicalName())) {
LOGGER.debug(() -> "Found class with contract annotation: " + classInfo.getName());
- final Class cls = (Class) classInfo.loadClass();
+
+ final Class> cls = classInfo.loadClass();
LOGGER.debug("Loaded class");
final String className = cls.getCanonicalName();
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/ledger/impl/LedgerImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/ledger/impl/LedgerImpl.java
index 5d204ba20..347c516e3 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/ledger/impl/LedgerImpl.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/ledger/impl/LedgerImpl.java
@@ -16,7 +16,6 @@ public final class LedgerImpl implements Ledger {
*
* @param ctx Context transactional context to use
*/
- @SuppressWarnings("PMD.UnusedFormalParameter")
public LedgerImpl(final Context ctx) {
// Empty stub
}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeServerProperties.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeServerProperties.java
index 8197be59e..865c93813 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeServerProperties.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ChaincodeServerProperties.java
@@ -41,7 +41,7 @@ public ChaincodeServerProperties() {
* @param permitKeepAliveWithoutCalls whether clients are allowed to send keep-alive HTTP/2 PINGs even if there are
* no outstanding RPCs on the connection.
*/
- @SuppressWarnings({"PMD.UnusedFormalParameter", "PMD.NullAssignment"})
+ @SuppressWarnings({"PMD.NullAssignment"})
public ChaincodeServerProperties(
final int portChaincodeServer,
final int maxInboundMetadataSize,
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementImpl.java
index 56cae1a03..0cc6b08e7 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementImpl.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementImpl.java
@@ -52,7 +52,7 @@ public byte[] policy() {
@Override
public void addOrgs(final RoleType role, final String... organizations) {
MSPRoleType mspRole;
- if (RoleType.RoleTypeMember.equals(role)) {
+ if (RoleType.RoleTypeMember == role) {
mspRole = MSPRoleType.MEMBER;
} else {
mspRole = MSPRoleType.PEER;
@@ -78,7 +78,7 @@ public List listOrgs() {
private void setMSPIDsFromSP(final SignaturePolicyEnvelope spe) {
spe.getIdentitiesList().stream()
- .filter(identity -> Classification.ROLE.equals(identity.getPrincipalClassification()))
+ .filter(identity -> Classification.ROLE == identity.getPrincipalClassification())
.forEach(this::addOrg);
}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeInvocationTask.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeInvocationTask.java
index 1f502b366..38865e2de 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeInvocationTask.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/ChaincodeInvocationTask.java
@@ -96,7 +96,7 @@ public ChaincodeMessage call() {
// Call chaincode's invoke
// Note in Fabric v2, there won't be any INIT
- if (this.type.equals(Type.INIT)) {
+ if (this.type == Type.INIT) {
result = chaincode.init(stub);
} else {
result = chaincode.invoke(stub);
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/QueryResultsIteratorImpl.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/QueryResultsIteratorImpl.java
index 893502040..fdddfb759 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/QueryResultsIteratorImpl.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/QueryResultsIteratorImpl.java
@@ -107,7 +107,7 @@ public T next() {
}
@Override
- public void close() throws Exception {
+ public void close() {
final ByteString requestPayload = QueryStateClose.newBuilder()
.setId(currentQueryResponse.getId())
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIterator.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIterator.java
index e31dfcb68..f37b6cab4 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIterator.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIterator.java
@@ -12,4 +12,7 @@
*
* @param the type of elements returned by the iterator
*/
-public interface QueryResultsIterator extends Iterable, AutoCloseable {}
+public interface QueryResultsIterator extends Iterable, AutoCloseable {
+ @Override
+ void close();
+}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIteratorWithMetadata.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIteratorWithMetadata.java
index b5c45cfa4..9bed89aa4 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIteratorWithMetadata.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ledger/QueryResultsIteratorWithMetadata.java
@@ -18,4 +18,7 @@
public interface QueryResultsIteratorWithMetadata extends Iterable, AutoCloseable {
/** @return Query Metadata */
QueryResponseMetadata getMetadata();
+
+ @Override
+ void close();
}
diff --git a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/traces/impl/OpenTelemetryTracesProvider.java b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/traces/impl/OpenTelemetryTracesProvider.java
index 4801ebe33..a834af040 100644
--- a/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/traces/impl/OpenTelemetryTracesProvider.java
+++ b/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/traces/impl/OpenTelemetryTracesProvider.java
@@ -67,6 +67,6 @@ public Span createSpan(final ChaincodeStub stub) {
@Override
public ClientInterceptor createInterceptor() {
- return grpcTracer.newClientInterceptor();
+ return grpcTracer.createClientInterceptor();
}
}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index a4b76b953..61285a659 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ff23a68d7..19a6bdeb8 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index f5feea6d6..adff685a0 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
-' "$PWD" ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -115,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -173,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -206,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
diff --git a/gradlew.bat b/gradlew.bat
index 9b42019c7..e509b2dd8 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
diff --git a/scripts/changelog.sh b/scripts/changelog.sh
deleted file mode 100755
index b74634c42..000000000
--- a/scripts/changelog.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright IBM Corp. All Rights Reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-set -ev
-
-PREVIOUS_TAG=$1
-NEW_VERSION=$2
-
-: ${PREVIOUS_TAG:?}
-: ${NEW_VERSION:?}
-
-echo "## ${NEW_VERSION}" >> CHANGELOG.new
-echo "$(date)" >> CHANGELOG.new
-echo "" >> CHANGELOG.new
-git log ${PREVIOUS_TAG}..HEAD --oneline | grep -v Merge | sed -e "s/\[\{0,1\}\(FAB[^0-9]*-[0-9]*\)\]\{0,1\}/\[\1\](https:\/\/jira.hyperledger.org\/browse\/\1\)/" -e "s/\([0-9|a-z]*\)/* \[\1\](https:\/\/github.com\/hyperledger\/fabric-chaincode-java\/commit\/\1)/" >> CHANGELOG.new
-echo "" >> CHANGELOG.new
-cat CHANGELOG.md >> CHANGELOG.new
-mv -f CHANGELOG.new CHANGELOG.md
-
diff --git a/scripts/gittag.sh b/scripts/gittag.sh
deleted file mode 100755
index c41fd8062..000000000
--- a/scripts/gittag.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-# Exit on first error, print all commands.
-set -e
-set -o pipefail
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
-
-# release name
-RELEASE=release-1.4
-
-function abort {
- echo "!! Exiting shell script"
- echo "!!" "$1"
- exit -1
-}
-
-# Run printVersionName task in the root directory, grab the first line and remove anything after the version number
-VERSION=$(cd ../ && ./gradlew -q printVersionName | head -n 1 | cut -d'-' -f1)
-
-echo New version string will be v${VERSION}
-
-# do the release notes for this new version exist?
-if [[ -f "${DIR}/release_notes/v${VERSION}.txt" ]]; then
- echo "Release notes exist, hope they make sense!"
-else
- abort "No releases notes under the file ${DIR}/release_notes/v${NEW_VERSION}.txt exist";
-fi
-
-git checkout "${RELEASE}"
-git pull
-git tag -a "v${VERSION}" `git log -n 1 --pretty=oneline | head -c7` -F release_notes/"v${VERSION}".txt
-git push origin v${VERSION} HEAD:refs/heads/${RELEASE}
\ No newline at end of file
diff --git a/scripts/multiarch.sh b/scripts/multiarch.sh
deleted file mode 100755
index 5795a46fd..000000000
--- a/scripts/multiarch.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# Copyright IBM Corp. All Rights Reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-usage() {
- echo "Usage: $0 "
- echo " and credentials for the repository"
- echo "ENV:"
- echo " NS=$NS"
- echo " VERSION=$VERSION"
- echo " TWO_DIGIT_VERSION=$TWO_DIGIT_VERSION"
- exit 1
-}
-
-missing() {
- echo "Error: some image(s) missing from registry"
- echo "ENV:"
- echo " NS=$NS"
- echo " VERSION=$VERSION"
- echo " TWO_DIGIT_VERSION=$TWO_DIGIT_VERSION"
- exit 1
-}
-
-failed() {
- echo "Error: multiarch manifest push failed"
- echo "ENV:"
- echo " NS=$NS"
- echo " VERSION=$VERSION"
- echo " TWO_DIGIT_VERSION=$TWO_DIGIT_VERSION"
- exit 1
-}
-
-USER=${1:-nobody}
-PASSWORD=${2:-nohow}
-NS=${NS:-hyperledger}
-VERSION=${BASE_VERSION:-1.3.0}
-TWO_DIGIT_VERSION=${TWO_DIGIT_VERSION:-1.3}
-
-if [ "$#" -ne 2 ]; then
- usage
-fi
-
-# verify that manifest-tool is installed and found on PATH
-which manifest-tool
-if [ "$?" -ne 0 ]; then
- echo "manifest-tool not installed or not found on PATH"
- exit 1
-fi
-
-IMAGES="fabric-javaenv"
-
-# check that all images have been published
-for image in ${IMAGES}; do
- docker pull ${NS}/${image}:amd64-${VERSION} || missing
-done
-
-# push the multiarch manifest and tag with just $VERSION and 'latest'
-for image in ${IMAGES}; do
- manifest-tool --username ${USER} --password ${PASSWORD} push from-args\
- --platforms linux/amd64 --template "${NS}/${image}:ARCH-${VERSION}"\
- --target "${NS}/${image}:${VERSION}"
-# manifest-tool --username ${USER} --password ${PASSWORD} push from-args\
-# --platforms linux/amd64 --template "${NS}/${image}:ARCH-${VERSION}"\
-# --target "${NS}/${image}:latest"
- manifest-tool --username ${USER} --password ${PASSWORD} push from-args\
- --platforms linux/amd64 --template "${NS}/${image}:ARCH-${VERSION}"\
- --target "${NS}/${image}:${TWO_DIGIT_VERSION}"
-done
-
-# test that manifest is working as expected
-for image in ${IMAGES}; do
- docker pull ${NS}/${image}:${VERSION} || failed
- docker pull ${NS}/${image}:${TWO_DIGIT_VERSION} || failed
-# docker pull ${NS}/${image}:latest || failed
-done
-
-echo "Successfully pushed multiarch manifest"
-exit 0
diff --git a/scripts/verify-commit.sh b/scripts/verify-commit.sh
deleted file mode 100755
index 0fb1dcd8d..000000000
--- a/scripts/verify-commit.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash -ue
-
-#
-# SPDX-License-Identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2018 IBM Corporation, The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License 2.0
-# which accompanies this distribution, and is available at
-# https://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# This script makes several basic commit message validations.
-# This is with the purpose of keeping up with the aesthetics of our code.
-# Verify if the commit message contains JIRA URLs.
-# its-jira pluggin attempts to process jira links and breaks.
-
-set +ue # Temporarily ignore any errors
-
-set -o pipefail
-echo "----> verify-commit.sh"
-
-if git rev-list --format=%B --max-count=1 HEAD | grep -io 'http[s]*://jira\..*' > /dev/null ; then
- echo 'Error: Remove JIRA URLs from commit message'
- echo 'Add jira references as: Issue: -, instead of URLs'
- exit 1
-fi
-
-# Check for trailing white-space (tab or spaces) in any files that were changed
-#commit_files=$(git diff-tree --name-only -r HEAD~2..HEAD)
-commit_files=$(find ./fabric-chaincode-shim/src -name *.java)
-
-found_trailing=false
-for filename in $commit_files; do
- if [[ $(file -b $filename) == "ASCII text"* ]]; then
- if egrep -q "\s$" $filename; then
- found_trailing=true
- echo "Error: Trailing white spaces found in file: $filename"
- fi
- fi
-done
-
-#if $found_trailing; then
-# echo "#### filename:line-num:line ####"
-# egrep -n "\s$" $commit_files
-# exit 1
-#fi
\ No newline at end of file