Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 213edec

Browse files
author
Saad Karim
committed
[FAB-6939] Eclipse Setup Instructions
Instructions on how to setup Eclipse with the Java SDK Change-Id: Ibc663163c0ae3b5d010d68b701bbb3455bfb75c6 Signed-off-by: Saad Karim <skarim@us.ibm.com>
1 parent c8cd86b commit 213edec

File tree

6 files changed

+60
-3
lines changed

6 files changed

+60
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ your server(s) hostname(s) and port(s).
312312
Go lang chaincode dependencies must be contained in vendor folder.
313313
For an explanation of this see [Vendor folder explanation](https://blog.gopheracademy.com/advent-2015/vendor-folder/)
314314

315+
### Setting Up Eclipse
316+
317+
To get started using the Fabric Java SDK with Eclipse, refer to the instructions at: ./docs/EclipseSetup.md
315318

316319
## Basic Troubleshooting
317320

checkstyle-config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<property name="checkFormat" value="$1"/>
5959
</module>
6060

61+
<module name="SuppressionFilter">
62+
<property name="file" value="suppressions.xml" />
63+
</module>
64+
6165
<module name="TreeWalker">
6266

6367
<!-- Required for SuppressionCommentFilter module -->

docs/EclipseSetup.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Eclipse Setup Instructions
2+
3+
## Pre-req
4+
5+
The following dependencies must be met:
6+
7+
* JDK 1.8 or above
8+
* Apache Maven
9+
10+
Set your JAVA\_HOME points to your installation of JDK 1.8 (or above) and make sure that JAVA_HOME/bin and Apache maven are in your PATH.
11+
12+
## Eclipse Setup
13+
14+
1. Download and install the latest Eclipse client
15+
16+
2. If you want to contribute to the project, you will need to make sure you are logged in to Gerrit and have setup your SSH keys. For more information on this, refer to: http://hyperledger-fabric.readthedocs.io/en/latest/Gerrit/lf-account.html
17+
18+
3. Clone the Java SDK from Gerrit. Make sure SSH and "Clone with commit-msg hook" are selected before you click on the copy to clipboard icon. Make sure the line you have copied has a: && scp .. errit.hyperledger.org:hooks/commit-msg fabric-sdk-java/.git/hooks/
19+
* https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-java
20+
21+
4. Download and Install Maven, if you haven't already.
22+
* https://maven.apache.org/download.cgi
23+
24+
5. Open up Eclipse to import the project. Go to File > Import > Maven > Existing Maven Project. Point to the location where you cloned the SDK in step 3.
25+
* If you see the error: **Failed to read the project description file (.project) for 'fabric-sdk-java'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state.** Remove the comments on top of .project file and .classpath and try importing the project again.
26+
27+
6. Hit Finish.
28+
* If you see error: **No marketplace entries found to handle maven-antrun-plugin:1.4:run in Eclipse. Please see Help for more information.** Continue to hit Finish. We will resolve this later.
29+
30+
7. Download dependencies. Navigate to you fabric-sdk-java folder, and execute the following command: **mvn install -DskipTests**
31+
32+
8. After running the command in step 6, you might see the following error in Eclipse: **Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.4:run (execution: default, phase: generate-test-resources).** Right click on the error and choose: **Mark goal run as ignored in eclipse.**
33+
34+
9. Enable Checkstyle. Go to Project > Properties > Checkstyle. Make sure the “Checkstyle active for this project”, “files outside source directories”, and “derived (generated) files” are all checked.
35+
36+
10. Hit “Local Check Configurations”, then select “New”. Choose “External Configuration File”, hit “Browse” and select “checkstyle-config.xml” from the fabric-sdk-java root directory.
37+
38+
11. Hit "Apply and Close", and the checkstyle will be applied.
39+
40+
Your eclipse environment should be set up now.

pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
</reports>
5353
</reportSet>
5454
</reportSets>
55+
<configuration>
56+
<suppressionsLocation>suppressions.xml</suppressionsLocation>
57+
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
58+
</configuration>
5559
</plugin>
5660
<!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin -->
5761
<plugin>
@@ -461,7 +465,6 @@
461465
<echo message="Creating diagnostic dump output directory"/>
462466
<mkdir dir="./target/diagDump"/>
463467
</tasks>
464-
465468
</configuration>
466469
<goals>
467470
<goal>run</goal>
@@ -500,7 +503,6 @@
500503
</archive>
501504
</configuration>
502505
</plugin>
503-
504506
</plugins>
505507
</build>
506508
<distributionManagement>

src/main/java/org/hyperledger/fabric/sdk/Channel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ class MatchPair {
30713071
}
30723072
}
30733073

3074-
List<MatchPair> matches = new LinkedList<>(); //Find matches.
3074+
List<MatchPair> matches = new LinkedList<MatchPair>(); //Find matches.
30753075

30763076
synchronized (chainCodeListeners) {
30773077

suppressions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
4+
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
5+
6+
<suppressions>
7+
<suppress checks="." files="src/test/fixture/sdkintegration/javacc/example_cc/src/main/java/example/SimpleChaincode.java"/>
8+
</suppressions>

0 commit comments

Comments
 (0)