A quick cheat sheet for working with Apache CloudStack using Maven.


Build Profiles

ProfileDescription
developerBuilds components useful during development (API, mgmt, etc).
systemvmBuilds SystemVM templates and related artifacts.
noredistExcludes non-distributable (e.g., proprietary) code.

Common Maven Commands

Full Build (excluding proprietary code):

mvn clean install -Pdeveloper -Dnoredist

Full Build with SystemVM:

mvn clean install -Pdeveloper,systemvm -Dnoredist

Build Specific Module:

mvn -Pdeveloper -pl <module-name> -am
  • -pl: Only build this module
  • -am: Also build required dependencies

Example:

mvn -Pdeveloper -pl server -am

Deploy the Database Schema

Used to initialize or reset the CloudStack database:

mvn -Pdeveloper -pl developer -Ddeploydb

Running Jetty (for legacy UI testing)

Run Jetty for the CloudStack UI (usually used during frontend development):

mvn -pl client jetty:run

Custom Java Options (JAVA_OPTS)

Useful for overriding JVM behavior (heap size, GC logging, IPv4 stack, etc.)

Example:

export JAVA_OPTS="-Xmx4G -Djava.net.preferIPv4Stack=true"

Applied via systemd override or environment file for cloudstack-management.


Build affected modules:

mvn -Pdeveloper -pl server -am

Final Packaging (DEB/RPM/TAR)

mvn clean package -Pdeveloper,systemvm -Dnoredist

Creates .deb, .rpm, .tar.gz in dist/target/.


Key Modules

ModuleDescription
apiAPI interfaces and command defs
serverCore logic, services, managers
clientUI code (old UI)
plugins/*Optional plugins (e.g. hypervisors)
developerDev tools (e.g., db deployment)
utilsShared utility classes