2016-09-15 10 views
0

Javaチェーンコードをコンパイルしようとしました。Javaチェーンコードをコンパイルするときにshim-client-1.0.jarが見つからない

以下のエラーが発生します。 問題を解決する方法を教えてください。

Could not resolve all dependencies for configuration ':examples:chaincode:java:Example:compileClasspath'. 

Could not find org.hyperledger:shim-client:1.0. 
    Searched in the following locations: 
     file:/C:/Users/IBM_ADMIN/.m2/repository/org/hyperledger/shim-client/1.0/shim-client-1.0.pom 
     file:/C:/Users/IBM_ADMIN/.m2/repository/org/hyperledger/shim-client/1.0/shim-client-1.0.jar 
     https://repo1.maven.org/maven2/org/hyperledger/shim-client/1.0/shim-client-1.0.pom 
     https://repo1.maven.org/maven2/org/hyperledger/shim-client/1.0/shim-client-1.0.jar 
    Required by: 
     fabric.examples.chaincode.java:Example:unspecified*** 
+0

また http://stackoverflow.com/questions/39493700/hyperledger-sdk-for-java-chaincode-shim-、以前の提案に言及したjarファイルをダウンロードするためのパスを見つけるDINTクライアント-1-0 –

答えて

5

、次のディレクトリに切り替えてください

github.com/hyperledger/fabric/core/chaincode/shim/java 

gradle buildを使用してそこに構築し、次のような出力が表示されるはずです、

一度行わ
:core:chaincode:shim:java:copyProtos 
:core:chaincode:shim:java:extractIncludeProto 
Download https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0-beta-2/protobuf-java-3.0.0-beta-2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-all/0.13.2/grpc-all-0.13.2.jar 
Download https://repo1.maven.org/maven2/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-netty/0.13.2/grpc-netty-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-auth/0.13.2/grpc-auth-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-nano/0.13.2/grpc-protobuf-nano-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-core/0.13.2/grpc-core-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/0.13.2/grpc-protobuf-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-okhttp/0.13.2/grpc-okhttp-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/grpc/grpc-stub/0.13.2/grpc-stub-0.13.2.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.0.CR3/netty-codec-http2-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.3.0/google-auth-library-oauth2-http-0.3.0.jar 
Download https://repo1.maven.org/maven2/com/google/guava/guava/18.0/guava-18.0.jar 
Download https://repo1.maven.org/maven2/com/google/protobuf/nano/protobuf-javanano/3.0.0-alpha-5/protobuf-javanano-3.0.0-alpha-5.jar 
Download https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar 
Download https://repo1.maven.org/maven2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar 
Download https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.5.0/okhttp-2.5.0.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.0.CR3/netty-codec-http-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.0.CR3/netty-handler-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.3.0/google-auth-library-credentials-0.3.0.jar 
Download https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.19.0/google-http-client-1.19.0.jar 
Download https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.19.0/google-http-client-jackson2-1.19.0.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.0.CR3/netty-codec-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.0.CR3/netty-buffer-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.0.CR3/netty-transport-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar 
Download https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.1.3/jackson-core-2.1.3.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-common/4.1.0.CR3/netty-common-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.0.CR3/netty-resolver-4.1.0.CR3.jar 
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar 
Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar 
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.3/commons-codec-1.3.jar 
:core:chaincode:shim:java:extractProto 
:core:chaincode:shim:java:generateProto 
:core:chaincode:shim:java:compileJava 
Note: /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/ChaincodeStub.java uses unchecked or unsafe operations. 
Note: Recompile with -Xlint:unchecked for details. 
:core:chaincode:shim:java:processResources 
:core:chaincode:shim:java:classes 
:core:chaincode:shim:java:jar 
:core:chaincode:shim:java:assemble 
:core:chaincode:shim:java:extractIncludeTestProto 
:core:chaincode:shim:java:extractTestProto 
:core:chaincode:shim:java:generateTestProto UP-TO-DATE 
:core:chaincode:shim:java:compileTestJava UP-TO-DATE 
:core:chaincode:shim:java:processTestResources UP-TO-DATE 
:core:chaincode:shim:java:testClasses UP-TO-DATE 
:core:chaincode:shim:java:test UP-TO-DATE 
:core:chaincode:shim:java:check UP-TO-DATE 
:core:chaincode:shim:java:build 
:core:chaincode:shim:java:copyToLib 
:core:chaincode:shim:java:generatePomFileForMavenJavaPublication 
:core:chaincode:shim:java:publishMavenJavaPublicationToMavenLocal 
:core:chaincode:shim:java:publishToMavenLocal 

BUILD SUCCESSFUL 

Total time: 42.466 secs 

、バック例Javaへの切り替えコードディレクトリに移動してもう一度ビルドしてください。gradle -b build.gradle build

それは、その後、罰金建設する

:examples:chaincode:java:SimpleSample:compileJava 
:examples:chaincode:java:SimpleSample:processResources UP-TO-DATE 
:examples:chaincode:java:SimpleSample:classes 
:examples:chaincode:java:SimpleSample:jar 
:examples:chaincode:java:SimpleSample:startScripts 
:examples:chaincode:java:SimpleSample:distTar 
:examples:chaincode:java:SimpleSample:distZip 
:examples:chaincode:java:SimpleSample:assemble 
:examples:chaincode:java:SimpleSample:compileTestJava UP-TO-DATE 
:examples:chaincode:java:SimpleSample:processTestResources UP-TO-DATE 
:examples:chaincode:java:SimpleSample:testClasses UP-TO-DATE 
:examples:chaincode:java:SimpleSample:test UP-TO-DATE 
:examples:chaincode:java:SimpleSample:check UP-TO-DATE 
:examples:chaincode:java:SimpleSample:build 
:examples:chaincode:java:SimpleSample:copyToLib 

BUILD SUCCESSFUL 

Total time: 8.43 secs 
+1

ありがとう@sufiyan。出来た :) –

関連する問題