我是 Hyperledger Fabric 的新手。当我从 cli 容器安装到对等点后实例化用 java 编写的链代码时,出现了一些问题:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.github.everit-org.json-schema:org.everit.json.schema:1.11.1.
Searched in the following locations:
file:/root/.m2/repository/com/github/everit-org/json-schema/org.everit.json.schema/1.11.1/org.everit.json.schema-1.11.1.pom
file:/root/.m2/repository/com/github/everit-org/json-schema/org.everit.json.schema/1.11.1/org.everit.json.schema-1.11.1.jar
https://repo.maven.apache.org/maven2/com/github/everit-org/json-schema/org.everit.json.schema/1.11.1/org.everit.json.schema-1.11.1.pom
https://repo.maven.apache.org/maven2/com/github/everit-org/json-schema/org.everit.json.schema/1.11.1/org.everit.json.schema-1.11.1.jar
Required by:
project : > org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:1.4.2
我认为这可能是 Maven 存储库的问题,但是当我在主机的终端中使用 gradle 时,它运行正常,如下所示:
fabric@ubuntu:~/fabric1.4/fabric-samples/chaincode/master-liuqi/java$ sudo /opt/gradle/bin/gradle -b build.gradle build
Task :compileJava
Note: /home/fabric/fabric1.4/fabric-samples/chaincode/master-liuqi/java/src/main/java/org/hyperledger/fabric/example/SimpleChaincode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed
下面是我的 build.gradle,它与 hyperleger 的示例链代码相同。
plugins {
id 'com.github.johnrengelman.shadow' version '2.0.3'
id 'java'
}
group 'org.hyperledger.fabric-chaincode-java'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '1.+'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
有什么办法可以解决这个问题吗?在主机和容器中运行 gradle build 有什么区别?
大话西游666
喵喔喔
相关分类