Maven HOWTO

Introduction

More information can be found on the Maven homepage. In particular, you might want to check out the documentation section and the plugin documentations.

Useful Commands

Below is a list of commonly-used helpful Maven commands.

CommandDescription
mvn cleanRemove all the generated files
mvn compileCompile the project
mvn testRun the unit test. Use "-Dtest=ClassName"
(not fully-qualified) to run individual tests
mvn siteCreates project site and reports
mvn packageCreate the JAR file
mvn releaseRelease the artifacts to the repository
mvn site-deployGenerate and deploy the site
mvn deployDeploy the JAR file to the repository
mvn idea:ideaCreate an IntelliJ IDEA project
mvn idea:cleanRemove the IntelliJ IDEA project
mvn eclipse:eclipseCreate an Eclipse project
mvn eclipse:cleanRemove the Eclipse project

Useful Properties

-Dmaven.test.skip=trueDo not execute the unit tests
-Dmaven.test.failure.ignore=trueContinue even if the unit tests have failed

Useful Commandline Switches

mvn -UCheck for updates for all snapshot releases
mvn -upCheck for updates for the plugins
mvn -oWork offline
mvn --helpSee full llist of optional commands