Maven : mvn command cheat sheet - 2020
This is really cheap mvn command cheat sheet.
create java project:
$ mvn archetype:create -DgroupId=org.yourcompany.project -DartifactId=application
create web project:
$ mvn archetype:create -DgroupId=org.yourcompany.project -DartifactId=application -DarchetypeArtifactId=maven-archetype-webapp
clean project: will delete target directory:
$ mvn clean
validate project: validate the project is correct and all necessary information is available:
$ mvn validate
compile project: compile source code, classes stored in target/classes:
$ mvn compile
test project: run tests using a suitable unit testing framework:
$ mvn test
package project: take the compiled code and package it in its distributable format, such as a JAR / WAR:
$ mvn package
verify project: run any checks to verify the package is valid and meets quality criteria:
$ mvn verify
install project: install the package into the local repository, for use as a dependency in other projects locally:
$ mvn install
deploy project: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects:
$ mvn deploy
deploy-file: can be used for deploying a external jar file to repository:
$ mvn deploy:deploy-file -Dfile=/path/to/jar/file -DrepositoryId=repos-server -Durl=http ://repos.company.org/test -DgroupId=javax -DartifactId=mail -Dpackaging=jar -Dversion=1.0.1
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization