File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do get default lifecycle phase?

 
Luke Murphy
Ranch Hand
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Luke Murphy
Ranch Hand
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic