Sunday, June 26, 2011

Useful Maven Commands

1. Compiling Maven Project

To compile a maven project open terminal & go to project folder & type
 mvn compile
or
mvn clean compile

Both commands will compile the maven project but mvn clean compile will always compile the project as newer project so that older compiled versions will be cleaned. So it is good to use clean compile to have a CLEAN project ;)

2. Installing or building the project

Type the following
mvn install
or
mvn clean install

This will compile, test & package the project into war or jar.

3. Offline usage
To work offline use commands as follows

mvn -o compile
mvn -o install
mvn -o test








No comments:

Post a Comment