Fabric-sdk-java source MAVEN Project Environment build

Source: Internet
Author: User

1. Download the source code through git

Https://github.com/hyperledger/fabric-sdk-java

2. Extract and import into Eclipse

Attention to environmental needs: Jdk1.8,eclipse try to use the latest version

If you import, there is a bomb box error: Failed to read the project description file (. Project) for ' Fabric-sdk-java-master '.  The file has been changed on disk, and it now contains invalid information. The project won't function properly until the description file is restored to a valid state.

Remove the. project file from the unpacked project file.

the first pom error after 3.maven update com.google.protobuf:protoc:exe:${os.detected.classifier}:3.0.0

Solution Method:

Simply write a main method in a Java project and enter the following code

System.out.println (System.getproperty ("Os.name"));
System.out.println (System.getproperty ("Os.arch"));

View the return value, such as returning Windows 7 AMD64 need to be converted to: windows-x86_64

Add <os.detected.classifier>windows-x86_64</os.detected.classifier> to Pom properties

Other return values in the Https://github.com/trustin/os-maven-plugin link to find the corresponding value in the conversion and write in the corresponding parameters of <os.detected.classifier>.

4. Second POM Error plugins partial label error

Solution: Use <pluginManagement> label on plugins to wrap it up

5. Classes in the third project that are partially grpc suffixes are not found

Workaround: Introduced in the Pom.xml file, the jar bundle dependency of the project itself can be

<dependency>
		<groupId>org.hyperledger.fabric-sdk-java</groupId>
		<artifactId> fabric-sdk-java</artifactid>
		<version>1.0.1</version>
</dependency>
Import this jar package that might not load in the Fabric-sdk-java in the project's MAVEN dependencies, causing the class in the project to import the class in the jar package. This is because the groupid of the project's Pom file is consistent with the groupid you introduced, and then change the groupid of the project to a different name.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.