As part of switching to Apache Maven for building CloudStack, the .classpath and .project files used by Eclipse were removed. This page describes how to get CloudStack loaded into an Eclipse workspace. For more details on the actual build process with maven see Building with Maven
These steps have been tested with Eclipse Indigo and Eclipse Juno- it's suggested you use that or a newer build.
To minimize confusion, start with a clean workspace with no other projects.
This wiki page shows how to install the Maven integration for Eclipse plugin. (For those using Yoxos, just search for M2E and add it to your Eclipse build)
After installing the plugin, restart Eclipse.
Now you can import CloudStack using the M2E plugin:
Eclipse will import the projects and build the code. At this point you should be able to develop and debug code as usual within Eclipse.
The Maven integration makes it reasonably easy to run and debug CloudStack through Eclipse. Basically, you can add the 'mvn' command-line calls to your Eclipse Workspace be defining corresponding Run Configurations.
The Maven commands we want to add as Run Configurations are discussed in detail on the Building with Maven page. The steps we want to add can be summarised as
Now, we could have combined steps 1 & 2 above, but splitting them allows incremental compilation. In contrast, combining them will make for a very slow build. Also, you only need to setup the database once after doing a Clean.
For each Run Configuration to be added:
$project_loc:cloudstack
(This tells Eclipse that the base directory for execution is the folder with a _pom.xml_ that has an <artifactId> with the value cloudstack)Maven will download everything needed to run CloudStack with Jetty, build the code, and run the UI. You can connect to it via http://localhost:8080/client.
The following commands were correct at the time of writing. If they don't work, double check the Building with Maven page, and if you have any compassion update this section of the wiki.
mvn clean
Base directory: $project_loc:cloudstack
Goals: clean install
Profiles: <empty>
mvn install
Base directory: $project_loc:cloudstack
Goals: clean install
Profiles: <empty>
mvn -P developer -pl developer -Ddeploydb=true
Base directory: $project_loc:cloudstack
Goals: -pl developer
Profiles: developer
Parameter Name: deploydb=true
mvn -pl client jetty:run
Base directory: $project_loc:cloudstack
Goals: -pl client jetty:run
Profiles: <empty>
mvn -pl awsapi jetty:run
Base directory: $project_loc:cloudstack
Goals: -pl awsapi jetty:run
Profiles: <empty>