tldr/pages/common/mvn.md

25 lines
497 B
Markdown
Raw Normal View History

2017-11-29 08:35:48 +00:00
# mvn
> Apache Maven.
> Tool for building and managing Java-based projects.
2017-11-29 08:35:48 +00:00
- Compile and build release package:
2017-11-29 08:35:48 +00:00
`mvn package`
- Execute with debug information:
2017-11-29 08:35:48 +00:00
`mvn -X package`
2017-11-29 08:35:48 +00:00
- Use an alternative POM(Project Object Model):
2017-11-29 08:42:02 +00:00
`mvn -f {{path/to/custom_pom.xml}} compile`
2017-11-29 08:42:02 +00:00
- Invoke more that one Lifecycle phase with arguments:
2017-11-29 08:42:02 +00:00
`mvn clean -P {{a_profile}} package clean`
2017-11-29 08:42:02 +00:00
- Run a class with a main method:
2017-11-29 08:35:48 +00:00
`mvn exec:java -Dexec.mainClass="{{com.example.Main}}" -Dexec.args="{{arg1 arg2}}"`