Maven Command line

maven hello world
mvn archetype:generate -DgroupId=[group] -DartifactId=[app] -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
cd [app]
mvn package
java -jar target/*.jar
generate an archetype from non standard archetype group
mvn archetype:generate -DgroupId=test -DartifactId=test -Dpackage=test \
 -Dname="parent top level" -Dversion="1.0" \
 -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root \
provided archetypes
list all archetypes
mvn archetype:generate
create eclipse project
mvn eclipse:eclipse
create eclipse project and download sources for dependencies
mvn eclipse:eclipse -DdownloadSources=true
mvn compile
force dependency resolution
mvn clean package -U
mvn compile exec:java -Dexec.mainClass=com.example.Example
create artifact
mvn clean package
create artifact and run integration tests
mvn clean verify
install artifact into local maven repository
mvn clean install
install artifact & source jar into local maven repository
clean install source:jar
run checkstyle
mvn checkstyle:checkstyle
create documentation site
mvn site
skip tests
mvn verify -Dmaven.test.skip=true
run tests, but ignore failures
mvn verify -Dmaven.test.failure.ignore=true
run a single cucumber test
mvn clean verify -Dcucumber.options="--tags @AC-115"


show the effective pom
mvn help:effective-pom
show the effective settings
mvn help:effective-settings
list active profiles
mvn help:active-profiles
describe a plugin
mvn help:describe -Dplugin=help
describe a plugin verbose
mvn help:describe -Dplugin=help -Dfull
describe a single goal of a plugin
mvn help:describe -Dplugin=help -Dmojo=help
show dependencies
mvn dependency:resolve
mvn dependency:resolve | sort | grep "    "
mvn dependency:tree
show dependency resolution for a specific dependency
mvn dependency:tree -Dverbose -Dincludes=commons-collections


Sets the current project's version and propagate onto child modules
mvn versions:set -DnewVersion=6.2.0 -DgenerateBackupPoms=false
mvn versions:set -DgroupId=org.apache.maven.* -DartifactId=* -DoldVersion=2.* -DnewVersion=2.1.0-SNAPSHOT
show versioned properties => generate HTML report of all dependencies
firefox target/site/property-updates-report.html

Maven POM

set java version for javac
Maven local dependency
exclude all transitive dependencies (maven3)
Maven OSGI ignore packages
    <bundleSource>svn+ssh://subversion/vol/subversion…. </bundleSource>

spring repo

repo URL
It can be browsed and searched directly via the web at