From 524b30871267cdc44eb290ab850ca505af28112e Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 13 Dec 2017 11:43:18 +0530 Subject: [PATCH] Restructuring the entire page --- pages/common/mvn.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pages/common/mvn.md b/pages/common/mvn.md index 2f4a23230..73858ab4e 100644 --- a/pages/common/mvn.md +++ b/pages/common/mvn.md @@ -3,21 +3,33 @@ > Apache Maven. > Tool for building and managing Java-based projects. -- Compile and build release package: +- Compile a project: + +`mvn compile` + +- Compile and package the compiled code in its distributable format, such as a `jar`: `mvn package` -- Execute with debug information: +- Compile and package, skipping unit tests: -`mvn -X package` +`mvn package -Dmaven.test.skip=true` -- Use an alternative POM(Project Object Model): +- Install the built package in local maven repository. (This will invoke the compile and package commands too): -`mvn -f {{path/to/custom_pom.xml}} compile` +`mvn install` -- Invoke more that one Lifecycle phase with arguments: +- Delete build artifacts from the target folder: -`mvn clean -P {{a_profile}} package clean` +`mvn clean` + +- Do a clean and then invoke the package phase: + +`mvn clean package` + +- Clean and then package the code with a given build profile: + +`mvn clean -P{{profile}} package` - Run a class with a main method: