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?
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.
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.