You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Helck <Ch...@us.icap.com> on 2007/05/10 23:35:05 UTC
Parent POM and basedir
In my parent POM I'd like to setup the PMD plugin with a set of rules in
src/site/pmd.xml. In my parent POM I have:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<targetJdk>1.5</targetJdk>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<rulesets>
<ruleset>${basedir}/src/site/pmd.xml</ruleset>
</rulesets>
</configuration>
</plugin>
The line <ruleset>${basedir}/src/site/pmd.xml</ruleset> causes problems
because a child POM tries to open its own file src/site/pmd.xml which
does not exist. How do I do this?
Thanks,
Christopher Helck
**********************************************************************
This communication and all information (including, but not limited to,
market prices/levels and data) contained therein (the "Information") is
for informational purposes only, is confidential, may be legally
privileged and is the intellectual property of ICAP plc and its affiliates
("ICAP") or third parties. No confidentiality or privilege is waived or
lost by any mistransmission. The Information is not, and should not
be construed as, an offer, bid or solicitation in relation to any
financial instrument or as an official confirmation of any transaction.
The Information is not warranted, including, but not limited, as to
completeness, timeliness or accuracy and is subject to change
without notice. ICAP assumes no liability for use or misuse of the
Information. All representations and warranties are expressly
disclaimed. The Information does not necessarily reflect the views of
ICAP. Access to the Information by anyone else other than the
recipient is unauthorized and any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it is prohibited. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and
notify the sender.
**********************************************************************
Re: Parent POM and basedir
Posted by Wendy Smoak <ws...@gmail.com>.
On 5/15/07, Chris Helck <Ch...@us.icap.com> wrote:
> Can you explain what you mean? I've already set things up with the
> extension but I'd rather change it now if that is the right thing to do.
>
> How can I make my rules file be a dependency of the PMD plugin? Do I
> have to recreate my own version of the plugin?
You can nest <dependencies><dependency> inside the <plugin> element.
Here's the model for the pom:
http://maven.apache.org/ref/2.0.4/maven-model/maven.html
Brian is correct that this is preferred over a build extension.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Parent POM and basedir
Posted by Chris Helck <Ch...@us.icap.com>.
Can you explain what you mean? I've already set things up with the
extension but I'd rather change it now if that is the right thing to do.
How can I make my rules file be a dependency of the PMD plugin? Do I
have to recreate my own version of the plugin?
Regards,
Christopher Helck
-----Original Message-----
From: Brian E. Fox [mailto:brianf@reply.infinity.nu]
Sent: Monday, May 14, 2007 7:06 PM
To: Maven Users List
Subject: RE: Parent POM and basedir
>Can PMD find things on the classpath the way Checkstyle can? In that
>case, deploy a jar with your rules, and add it as a build extension so
>it's available on the classpath.
Yes it can. Although the preferred method is to make it a dependency of
the PMD plugin. Extensions work, but it's precarious and seems to be
headed for deprecation. (both of the last 2 releases had a regression on
this that needed to be fixed just prior to release.)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
**********************************************************************
This communication and all information (including, but not limited to,
market prices/levels and data) contained therein (the "Information") is
for informational purposes only, is confidential, may be legally
privileged and is the intellectual property of ICAP plc and its affiliates
("ICAP") or third parties. No confidentiality or privilege is waived or
lost by any mistransmission. The Information is not, and should not
be construed as, an offer, bid or solicitation in relation to any
financial instrument or as an official confirmation of any transaction.
The Information is not warranted, including, but not limited, as to
completeness, timeliness or accuracy and is subject to change
without notice. ICAP assumes no liability for use or misuse of the
Information. All representations and warranties are expressly
disclaimed. The Information does not necessarily reflect the views of
ICAP. Access to the Information by anyone else other than the
recipient is unauthorized and any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it is prohibited. If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and
notify the sender.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Parent POM and basedir
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>Can PMD find things on the classpath the way Checkstyle can? In that
>case, deploy a jar with your rules, and add it as a build extension so
>it's available on the classpath.
Yes it can. Although the preferred method is to make it a dependency of
the PMD plugin. Extensions work, but it's precarious and seems to be
headed for deprecation. (both of the last 2 releases had a regression on
this that needed to be fixed just prior to release.)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Parent POM and basedir
Posted by Wendy Smoak <ws...@gmail.com>.
On 5/10/07, Chris Helck <Ch...@us.icap.com> wrote:
>
> In my parent POM I'd like to setup the PMD plugin with a set of rules in
> src/site/pmd.xml. In my parent POM I have:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-pmd-plugin</artifactId>
> <configuration>
> <targetJdk>1.5</targetJdk>
> <linkXref>true</linkXref>
> <sourceEncoding>utf-8</sourceEncoding>
> <minimumTokens>100</minimumTokens>
> <rulesets>
> <ruleset>${basedir}/src/site/pmd.xml</ruleset>
> </rulesets>
> </configuration>
> </plugin>
>
> The line <ruleset>${basedir}/src/site/pmd.xml</ruleset> causes problems
> because a child POM tries to open its own file src/site/pmd.xml which
> does not exist. How do I do this?
Can PMD find things on the classpath the way Checkstyle can? In that
case, deploy a jar with your rules, and add it as a build extension so
it's available on the classpath.
${basedir} won't work, it changes for each module. Ther is no
reliable "top" of the project -- some pom hierarchies follow up to a
pom that isn't under your direct control, such as the top-level ASF
pom, or a company-wide parent pom that everyone is required to use.
Relative paths might also work, but then you wouldn't be able to check
out only a piece of the project and still have it build successfully.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org