Maven: Command line cheatsheet

Here you find a quick reference to Maven commands.

Available commands

mvn -Dtest=<unqualified-classname> test
Tests only the specified class.
mvn -Dmaven.surefire.debug test
Enables remote debugging of tests on port 5005. Surefire blocks on the port until you connect with your debugger.
mvn -Dcargo.wait=true -P int integration-test
Runs CS in Tomcat via cargo.
mvn help:effective-pom
Shows the logical contents of a pom.xml, including contents inherited from the parent pom.xml, up to and including the Maven super POM.
mvn dependency:tree
Shows all dependencies (including transitive dependencies) of your project. This is very helpful for debugging dependency version issues.
mvn -X <package-name>
Shows all explicit and transitive dependencies for a package, helping to identify conflicts.
mvn dependency:sources
Downloads all project sources separate from IDE project creation. Execute from root of parent project, then have your IDE synch up sources.

Not currently available commands

mvn -Dupgrade.version=<version you're upgrading to> com.jivesoftware.maven:maven-upgrade-plugin:upgrade

Generates a list of diff files based on product changes that correspond to your overlays. Also generates a mirrored directory structure with product files that enables you to diff against your project's web directory.

Note: Using this command requires SVN access; a version is in development to use Maven dependencies instead.