Setup TomP2P with Eclipse

The following steps describe how to work with TomP2P either with a released version or with the latest development version.

Setup TomP2P with a released version

  1. Download Eclipse. The latest version is recommended
  2. Unzip and run it
  3. Click on “Help” -> “Eclipse Marketplace” -> search for “m2e” and install "Maven Integration for Eclipse"
  4. File -> New Java Project -> enter name, e.g. TestTomP2P
  5. Right click on TestTomP2P in the package explorer -> Configure -> Convert to Maven Project
  6. edit pom.xml -> add below the version-tag:
<repositories>
  <repository>
    <id>tomp2p.net</id>
    <url>http://tomp2p.net/dev/mvn/</url>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>net.tomp2p</groupId>
    <artifactId>TomP2P</artifactId>
    <version>4.x</version>
  </dependency>
</dependencies>

Replace the 4.x with the latest version and now you can start a new class and you can use TomP2P.

Setup TomP2P with the latest development version

  1. Download Eclipse. The latest version is recommended
  2. Unzip and run it
  3. Click on “Help” -> “Eclipse Marketplace” -> search for “m2e” and install "Maven Integration for Eclipse"
  4. After restarting Eclipse, go to “Window” -> “Show View” -> “Git Repository Exploring”. Copy the URL “https://github.com/tomp2p/TomP2P.git” and paste in the the Git Repository View (Paste Repository Path or URI). Click “next” -> select “master”, unselect the others -> next -> finish
  5. Right click on “TomP2P” in the repository view and click “Import Projects...” -> Select “Import as general project” -> next -> finsh
  6. Go to the Java perspective and click on “View Menu” (this is the triangle right next to minimize and maximize in the Package Explorer pane). Select “Filters...” and unselect “*.resources” -> ok
  7. Open .project and replate these empty XML tags in .project
<buildSpec>
</buildSpec>
<natures>
</natures>

with

<buildSpec>
  <buildCommand>
    <name>org.eclipse.jdt.core.javabuilder</name>
    <arguments>
    </arguments>
  </buildCommand>
  <buildCommand>
    <name>org.eclipse.m2e.core.maven2Builder</name>
    <arguments>
    </arguments>
  </buildCommand>
</buildSpec>
<natures>
  <nature>org.eclipse.m2e.core.maven2Nature</nature>
  <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

Then right click on “TomP2P” -> “Maven” -> “Update Project...” -> ok. Now you are ready to go and you can reference this project in your own project (Properties -> Java Build Path -> Projects -> Add... -> and select TomP2P).