Posted in Information Technology, Software Engineering

Maven Cheat Sheet


General command structure

mvn -P<profile> <command> <scope>

Simple stuff

mvn help
mvn compile
mvn validate
mvn verify
mvn test
mvn clean 
mvn clean package
mvn clean install
mvn clean deploy


mvn archetype:create                    # Create pom.xml

mvn archetype:create -DgroupId=<group> \     # Create JAR
                     -DartifactId=<new id>

mvn archetype:create -DgroupId=<group> \     # Create WAR
                     -DartifactId=<new id> \

mvn install:install-file <params>            # Install dependencies


mvn deploy:deploy-file <params ...>

# Useful release options:
#    -P <profile>
#    -Dusername=<user>
#    -Dpassword=<password>
mvn release:prepare
mvn release:clean
mvn release:perform

Tomcat Plugin

mvn tomcat:deploy
mvn tomcat:redeploy
mvn tomcat:undeploy
mvn tomcat:stop
mvn tomcat:start

IDE integration

mvn -Declipse.workspace=<path> eclipse:add-maven-repo
mvn eclipse:eclipse

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s