Pre-requisites

  1. Java 7+ Oracle JDK or http://openjdk.java.net/install/index.html 

  2. Git 

  3. Download and install Eclipse. 

  4. Download and install Maven.

  5. Install the M2Eclipse plugin.

Configure the jclouds Repo

  1. Fork the jclouds repo and clone your fork 

    1. git clone git@github.com:username/jclouds.git 

    2. cd jclouds 
    3. mvn clean install This will download all dependencies you'll need so you can easily import the project and have it working.

Configure the project in Eclipse

  1. File > Import > Maven > Existing Maven Project. 

  2. Go to the cloned jclouds directory and select the provider or API you want to import (it is usually much easier to just import the provider or API you want to work with than importing the entire jclouds project).
  3. In the project root, edit the .project file and make sure it has, at least, the Java and Maven builders and natures, as in the following example:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    	<name>azurecompute-arm</name>
    	<comment></comment>
        <projects>
        </projects>
        <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>
    </projectDescription>
  4. In the project root, create the .classpath file with the following content (this assumes the workspace default JRE is the JDK you can use to build jclouds. if it's not the case you can change it later going to Project > properties > Java build Path > Libraries):

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    	<classpathentry kind="src" path="src/main/java"/>
    	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
    	<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
    	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    		<attributes>
    			<attribute name="maven.pomderived" value="true"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="src" path=".apt_generated">
    		<attributes>
    			<attribute name="optional" value="true"/>
    		</attributes>
    	</classpathentry>
    	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    	<classpathentry kind="output" path="target/classes"/>
    </classpath>
    
    
  5. Go to Project > Properties > Java Compiler > Annotation processing and enable annotation processing.
  6. Go to Project > Properties > Java Compiler > Annotation processing > Factory Path and enable Project specific settings.
    1. Click Add External JAR, then navigate to your local Maven repository and select the file: ~/.m2/repository/com/google/auto/value/auto-value/1.4.1/auto-value-1.4.1.jar

Next you might want to learn How to Contribute!

  • No labels