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