You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Subhash Chandran <su...@gmail.com> on 2006/03/18 19:15:41 UTC

[m2]maven-pmd-plugin - custom ruleset support classes

We have custom rulesets written in our company. The HOWTO in the plugin page
says how to specify the rulesets in the pom.xml:

http://maven.apache.org/plugins/maven-pmd-plugin/howto.html

But our ruleset XML files refer to custom written classes, which are
packaged in a separate Jar. How to specify this Jar in the classpath while
running PMD plugin?

--
Regards,
Subhash Chandran S

Cross platform OpenSource Java based file encryption software:
http://www.WizTools.org/project/WizCrypt/

Re: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Subhash Chandran <su...@gmail.com>.
I have created an issue for this:

http://jira.codehaus.org/browse/MPMD-22

Regards,
Subhash.

On 3/19/06, Subhash Chandran <su...@gmail.com> wrote:
>
> Thanks Wayne for the advice. I will try this out and let u know.
>
> One of the other round-abouts I tried: I tried to write a plugin extending
> maven-pmd-plugin, having our PMD extension as a dependency. But this threw
> some odd exception (i don't have trace as I am writing this from home).
> Maintaining this instead of a fork would have been easier. But for the time
> being I will decide to go about maintaining a fork.
>
> Thanks once again.
> Regards,
> Subhash.
>
>
> On 3/19/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > Oh I didn't understand the question the first time! Went back and now
> > I understand better... Ignore my first response completely. ;-)
> >
> > I would just add the jar file as follows:
> > <plugin>
> > maven-pmd-plugin
> > etc
> > <dependencies>
> > <dependency>
> > your jar here
> > </dep>
> > </deps>
> > </plugin>
> >
> > However... I think right now, the maven-pmd-plugin does not support
> > custom rulesets, so either way you're going to need to run an
> > internal/private version for a while until the next release is pushed
> > out that supports custom XML rulesets.
> >
> > Wayne
> >
> >
> >

RE: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Jeff Jensen <je...@upstairstechnology.com>.
Install the custom ruleset jar file in the local Maven repo and add it as a
project dependency.  Your custom classes are then on the classpath, and PMD
runs successfully with your custom ruleset.
 

-----Original Message-----
From: Subhash Chandran [mailto:subwiz@gmail.com] 
Sent: Saturday, March 18, 2006 12:56 PM
To: Maven Users List
Subject: Re: [m2]maven-pmd-plugin - custom ruleset support classes

Thanks Wayne for the advice. I will try this out and let u know.

One of the other round-abouts I tried: I tried to write a plugin extending
maven-pmd-plugin, having our PMD extension as a dependency. But this threw
some odd exception (i don't have trace as I am writing this from home).
Maintaining this instead of a fork would have been easier. But for the time
being I will decide to go about maintaining a fork.

Thanks once again.
Regards,
Subhash.

On 3/19/06, Wayne Fay <wa...@gmail.com> wrote:
>
> Oh I didn't understand the question the first time! Went back and now 
> I understand better... Ignore my first response completely. ;-)
>
> I would just add the jar file as follows:
> <plugin>
> maven-pmd-plugin
> etc
> <dependencies>
> <dependency>
> your jar here
> </dep>
> </deps>
> </plugin>
>
> However... I think right now, the maven-pmd-plugin does not support 
> custom rulesets, so either way you're going to need to run an 
> internal/private version for a while until the next release is pushed 
> out that supports custom XML rulesets.
>
> Wayne
>
>
> On 3/18/06, Subhash Chandran <su...@gmail.com> wrote:
> > ---- quote start ----
> > Personally, I think you should Maven2-ize the other project, and run 
> > PMD directly on it, instead of doing this convoluted thing...
> > ---- quote end ----
> >
> > Well, even if I mavenize our plugin-extension project, where will I 
> > add
> the
> > dependency? The only logical place I can believe is PMD plugin's
> dependency
> > section. This would mean we, in our company maintaining a fork 
> > version
> of
> > PMD plugin, which we want to avoid.
> >
> > Regards,
> > Subhash.
> >
> > On 3/18/06, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > Perhaps need to use assembly plugin to unzip the the Jar and then 
> > > let PMD run on the classes directly?
> > >
> > > (Personally, I think you should Maven2-ize the other project, and 
> > > run PMD directly on it, instead of doing this convoluted thing...)
> > >
> > > Wayne
> > >
> > >
> >
> >
>



--
Regards,
Subhash Chandran S

Cross platform OpenSource Java based file encryption software:
http://www.WizTools.org/project/WizCrypt/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Subhash Chandran <su...@gmail.com>.
Thanks Wayne for the advice. I will try this out and let u know.

One of the other round-abouts I tried: I tried to write a plugin extending
maven-pmd-plugin, having our PMD extension as a dependency. But this threw
some odd exception (i don't have trace as I am writing this from home).
Maintaining this instead of a fork would have been easier. But for the time
being I will decide to go about maintaining a fork.

Thanks once again.
Regards,
Subhash.

On 3/19/06, Wayne Fay <wa...@gmail.com> wrote:
>
> Oh I didn't understand the question the first time! Went back and now
> I understand better... Ignore my first response completely. ;-)
>
> I would just add the jar file as follows:
> <plugin>
> maven-pmd-plugin
> etc
> <dependencies>
> <dependency>
> your jar here
> </dep>
> </deps>
> </plugin>
>
> However... I think right now, the maven-pmd-plugin does not support
> custom rulesets, so either way you're going to need to run an
> internal/private version for a while until the next release is pushed
> out that supports custom XML rulesets.
>
> Wayne
>
>
> On 3/18/06, Subhash Chandran <su...@gmail.com> wrote:
> > ---- quote start ----
> > Personally, I think you should Maven2-ize the other project, and run
> > PMD directly on it, instead of doing this convoluted thing...
> > ---- quote end ----
> >
> > Well, even if I mavenize our plugin-extension project, where will I add
> the
> > dependency? The only logical place I can believe is PMD plugin's
> dependency
> > section. This would mean we, in our company maintaining a fork version
> of
> > PMD plugin, which we want to avoid.
> >
> > Regards,
> > Subhash.
> >
> > On 3/18/06, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > Perhaps need to use assembly plugin to unzip the the Jar and then let
> > > PMD run on the classes directly?
> > >
> > > (Personally, I think you should Maven2-ize the other project, and run
> > > PMD directly on it, instead of doing this convoluted thing...)
> > >
> > > Wayne
> > >
> > >
> >
> >
>



--
Regards,
Subhash Chandran S

Cross platform OpenSource Java based file encryption software:
http://www.WizTools.org/project/WizCrypt/

Re: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Wayne Fay <wa...@gmail.com>.
Oh I didn't understand the question the first time! Went back and now
I understand better... Ignore my first response completely. ;-)

I would just add the jar file as follows:
<plugin>
maven-pmd-plugin
etc
<dependencies>
<dependency>
your jar here
</dep>
</deps>
</plugin>

However... I think right now, the maven-pmd-plugin does not support
custom rulesets, so either way you're going to need to run an
internal/private version for a while until the next release is pushed
out that supports custom XML rulesets.

Wayne


On 3/18/06, Subhash Chandran <su...@gmail.com> wrote:
> ---- quote start ----
> Personally, I think you should Maven2-ize the other project, and run
> PMD directly on it, instead of doing this convoluted thing...
> ---- quote end ----
>
> Well, even if I mavenize our plugin-extension project, where will I add the
> dependency? The only logical place I can believe is PMD plugin's dependency
> section. This would mean we, in our company maintaining a fork version of
> PMD plugin, which we want to avoid.
>
> Regards,
> Subhash.
>
> On 3/18/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > Perhaps need to use assembly plugin to unzip the the Jar and then let
> > PMD run on the classes directly?
> >
> > (Personally, I think you should Maven2-ize the other project, and run
> > PMD directly on it, instead of doing this convoluted thing...)
> >
> > Wayne
> >
> >
>
>

Re: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Subhash Chandran <su...@gmail.com>.
---- quote start ----
Personally, I think you should Maven2-ize the other project, and run
PMD directly on it, instead of doing this convoluted thing...
---- quote end ----

Well, even if I mavenize our plugin-extension project, where will I add the
dependency? The only logical place I can believe is PMD plugin's dependency
section. This would mean we, in our company maintaining a fork version of
PMD plugin, which we want to avoid.

Regards,
Subhash.

On 3/18/06, Wayne Fay <wa...@gmail.com> wrote:
>
> Perhaps need to use assembly plugin to unzip the the Jar and then let
> PMD run on the classes directly?
>
> (Personally, I think you should Maven2-ize the other project, and run
> PMD directly on it, instead of doing this convoluted thing...)
>
> Wayne
>
>

Re: [m2]maven-pmd-plugin - custom ruleset support classes

Posted by Wayne Fay <wa...@gmail.com>.
Perhaps need to use assembly plugin to unzip the the Jar and then let
PMD run on the classes directly?

(Personally, I think you should Maven2-ize the other project, and run
PMD directly on it, instead of doing this convoluted thing...)

Wayne


On 3/18/06, Subhash Chandran <su...@gmail.com> wrote:
> We have custom rulesets written in our company. The HOWTO in the plugin page
> says how to specify the rulesets in the pom.xml:
>
> http://maven.apache.org/plugins/maven-pmd-plugin/howto.html
>
> But our ruleset XML files refer to custom written classes, which are
> packaged in a separate Jar. How to specify this Jar in the classpath while
> running PMD plugin?
>
> --
> Regards,
> Subhash Chandran S
>
> Cross platform OpenSource Java based file encryption software:
> http://www.WizTools.org/project/WizCrypt/
>
>