I cannot test it right now, but have you tried setting two different executions for the plugin. By the way check seems to only concern pmd, and "cpd-check" cpd.
http://maven.apache.org/plugins/maven-pmd-plugin/examples/violationChecking.html My 2 cents. 2011/8/9 Derek Lewis <[email protected]> > Hello, > > I've been working with Oskar, trying to figure out how to go about > configuring PMD and CPD at the same time, but with different > configurations. > > After investigating things further (via the internals of the > maven-pmd-plugin) it looks like the check goal invokes the pmd goal through > some built in Maven functionality that allows goals to invoke other goals. > However, I don't see any way to configure the goal that's being invoked, > for > that particular execution. ie. when check invokes pmd, I can configure the > check goal, but not the pmd goal, unless I put the configuration outside > the > execution, which causes it to affect other executions. > > Is there something we're missing about being able to configure these > chained > goals? > > Thanks, > Derek > > On Mon, Aug 8, 2011 at 9:23 AM, Oskar Separovic < > [email protected]> wrote: > > > Hello, > > > > We're using the PMD plugin to run both PMD and CPD on our codebase, > > however, we've come across > > a problem that has led us to disable CPD as a workaround. Specifically, > we > > want to run PMD on all our > > code, but run CPD on only production code. The <includeTests> > configuration > > tag appears to allow us to do this, > > however, when running both PMD and CPD, there doesn't seem to be any way > to > > configure them differently. > > > > The problem seems to be that when you add configuration tags within an > > execution, the tags are specific to the goal specified, > > and have no function if the goal doesn't support them, even if that goal > > invokes > > another goal that does support those configuration tags. > > > > For the PMD plugin this means that when the check/cpd-check goals invoke > > the > > pmd/cpd goals, the pmd/cpd goals cannot be configured within the > execution. > > > > If another execution configures the pmd/cpd goals, then the goals will > > run twice, once with the specified configuration and once with the > default > > configuration. > > > > The only way to configure the pmd/cpd goals when invoked from the > > check/cpd-check goals > > is to add them to a configuration outside the execution. > > > > The problem with this is that the configuration outside the executions > > applies to > > both the pmd and cpd goals, so the pmd and cpd goals cannot be configured > > differently > > (for example running pmd on tests but not cpd). > > > > The best suggestion we have come up with to fix this is for the > > check/cpd-check goals > > to support all the configuration tags of the pmd and cpd goals > > respectively, and somehow pass them > > to the pmd and cpd goals when the check goals invoke them. > > > > For example configuring the check goal like this currently does not work, > > but ideally it should > > pass the rulesets configuration to the pmd goal that is invoked: > > > > <execution> > > <id>compliance-pmd</id> > > <phase>verify</phase> > > <goals> > > <goal>check</goal> > > </goals> > > <configuration> > > <rulesets> > > <ruleset>rules/pmd-rules.xml</ruleset> > > </rulesets> > > </configuration> > > </execution> > > > > Does anyone have comments on the feasibility of implementing such a > > solution? > > > > [http://elasticpath.com/images/ep.gif] > > Oskar Separovic, Release Engineer > > Phone: 604.408.8078 ext. 744 > > Email: [email protected]<mailto: > > [email protected]> > > > > Elastic Path Software, Inc. > > Web elasticpath.com <http://www.elasticpath.com/> | Blog getelastic.com< > > http://www.getelastic.com/> | Twitter twitter.com/elasticpath < > > http://www.twitter.com/elasticpath> > > Careers elasticpath.com/jobs<http://www.elasticpath.com/jobs> | > Community > > grep.elasticpath.com <http://grep.elasticpath.com/> > > > > Confidentiality Notice: This message is intended only for the use of the > > designated addressee(s), and may contain information that is privileged, > > confidential and exempt from disclosure. Any unauthorized viewing, > > disclosure, copying, distribution or use of information contained in this > > e-mail is prohibited and may be unlawful. If you received this e-mail in > > error, please reply to the sender immediately to inform us you are not > the > > intended recipient and delete the email from your computer system. > > > > > > > > > -- Baptiste <Batmat> MATHUS - http://batmat.net Sauvez un arbre, Mangez un castor !
