Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 How to build CloudStack. A modern appliance based CloudStack development can be explored with MonkeyBox.

Use a Recent Eclipse Build

...

Download the CloudStack source code via git with:

Code Block

git clone git clone https://git-wip-usgitbox.apache.org/repos/asf/cloudstack.git

...

Here's a list of parent projects you should do this with:

  • cloudstack
  • cloudstack-framework
  • cloudcloudstack-servicesplugins
  • cloudstack-frameworkservices
  • cloud-enginecloudstack-plugins
Avoiding conflicts between builds outside of Eclipse and Eclipse's auto-building

...

  • Exit Eclipse (assuming you've already installed the m2e plugin)
  • cd cd [cloudstack home]
  • bash -x tools/eclipse/set-eclipse-profile.sh
  • Restart Eclipse

Upgrading Java

CloudStack has requirement for a newer 1.7 JDK, the default on my Mac was 1.6. You need to download the latest JDK from Oracle JDK Download.

The installation on my Mac was not in the default location: /System/Library/Java/JavaVirtualMachines but in location: /Library/Java/JavaVirtualMachines/.

You can have multiple JRE/JDKs installed on your system, you need to add the path to the new JDK to Eclipse Preferences>Java>Installed JREs

 For my JDK, the exact path I programmed was:  /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home. Your path may be different depending on the current JDK version.

Bonus Track: Running CloudStack Through Eclipse

...

The following commands were correct at the time of writing.  If they don't work, double check the How to build CloudStack page, and if you have any compassion update this section of the wiki.

Clean:
Code Block

 mvn clean

Base directory: $project_loc:cloudstack
Goals: clean install
Profiles: <empty>

Install (i.e. build):
Code Block

 mvn install

Base directory: $project_loc:cloudstack
Goals: clean install
Profiles: <empty>

Deploy Database (do once after a 'Clean'): mvn install:
Code Block

 mvn -P developer -pl developer -Ddeploydb=true

...

Jetty-based launch (of management server)
Code Block

 mvn -pl client jetty:run

Base directory: $project_loc:/cloud-client-ui
Goals: jetty:run
Profiles: <empty>

(Optional) launch the jetty based awsapi server:
Code Block

 mvn -pl awsapi jetty:run

Base directory: $project_loc:cloudstack
Goals: -pl awsapi jetty:run
Profiles: <empty>

...