Thursday, February 4, 2010

Maven

UPDATE VERSION NUMBERS IN MULTI MODULE PROJECT:- mvn -e release:update-versions -DautoVersionSubmodules=true

View Super POM via effective-pom:- mvn help:effective-pom
Maven has:- Lifecycles, Phases, Plugins and Goals.

mvn deploy : deploy is a lifecycle. Which has phases verification, compilation, testing and packaging.

Executing phase or goal: mvn compile:compile jar:jar

Prepare your project to go offline: mvn dependency:go-offline

Go offline: mvn -o

Help for plugin:- mvn help:describe –D
Ex:- mvn help:describe -Dplugin=help -Dfull

Help for profiles:- mvn help:active-profiles

List hierarchy of dependencies:- mvn dependency:tree

List dependencies in alphabetic form:- mvn dependency:resolve

List plugin dependencies in alphabetic form:- mvn dependency:resolve-plugins

Analyze dependencies and list any that are unused, or undeclared.:- mvn dependency:analyze

Printing exception stack trace for a goal:- mvn -e

Output debugging info for a goal:- mvn -X

Debugging a unit test:- mvn test -Dmaven.surefire.debug

Manual Profile activation:- mvn –P YourProfile

Release using maven:- mvn release:perform

Creating archetype from project:- mvn archetype:create-from-project