aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes How do get default lifecycle phase? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "How do get default lifecycle phase?" Watch "How do get default lifecycle phase?" New topic
Author

How do get default lifecycle phase?

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 299
1. When you define a plugin to be part of build or reporting, the goals for that plugin bind themselves to lifecycle phases. Anyone got any good tips for finding out the default phase? Is there a command or anything? I am using the PMD plugin but can't find its default phase.

2. Can you only define a plugin in <build> or <reporting>? Anywhere else?

3. If you have to define a plugin in build or reporting, is there anyway you can unbind its goals from all lifecycle phases? This would mean it is *never* called during build or site?

Cheers.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5575

1) If the plugin developers used the standard reports when generating the web site for their plugin, the page for the goal should tell you the default phase. Here is an example (not the "Binds by default" text):
http://maven.apache.org/plugins/maven-pmd-plugin/cpd-check-mojo.html

Which goal of the PMD plugin are you using? I noticed that two of the goals bind to the verify phase. The other goals do not bind to any phase so you have to specify one in your pom.xml.

2) You can also define one in <profile>.
The POM layout is defined here: maven.apache.org/ref/3.0.3/maven-model/maven.html

3) Some plugins have a "skip" or "ignore" property. But in general, define a profile, include the plugin/report in there and then enable and disable the profile as you see fit.


JBoss In Action
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 299
Peter Johnson wrote:1) If the plugin developers used the standard reports when generating the web site for their plugin, the page for the goal should tell you the default phase. Here is an example (not the "Binds by default" text):
http://maven.apache.org/plugins/maven-pmd-plugin/cpd-check-mojo.html

Which goal of the PMD plugin are you using? I noticed that two of the goals bind to the verify phase. The other goals do not bind to any phase so you have to specify one in your pom.xml.

2) You can also define one in <profile>.
The POM layout is defined here: maven.apache.org/ref/3.0.3/maven-model/maven.html

3) Some plugins have a "skip" or "ignore" property. But in general, define a profile, include the plugin/report in there and then enable and disable the profile as you see fit.


Great answer Peter.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How do get default lifecycle phase?
 
Similar Threads
maven with checkstyle configuration
emma-maven-plugin - filter excludes
Simple MAVEN questions
Maven alternate/custom lifecycle
Build problem with maven and eclipse web project