[
https://issues.apache.org/jira/browse/MPMD-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17097945#comment-17097945
]
Luigi Berrettini edited comment on MPMD-303 at 5/2/20, 12:24 PM:
-----------------------------------------------------------------
{quote}Only when you run {{mvn pmd:pmd}} directly, your configuration is not
applied - that's because, in that case, the reporting configuration is not used
and you need to configure the m-pmd-p under {{<build>/<plugins>}} as a build
plugin in addition to the reporting plugin.
See also [http://maven.apache.org/guides/mini/guide-configuring-plugins.html]
{quote}
I did read the Maven guide and [it
says|[http://maven.apache.org/guides/mini/guide-configuring-plugins.html#using-the-reporting-tag-vs-build-tag]|http://maven.apache.org/guides/mini/guide-configuring-plugins.html#using-the-reporting-tag-vs-build-tag]:
{{mvn aplugin:areportgoal}}
It uses *firstly* the parameters defined in the <configuration> element of each
reporting Plugin specified in the <reporting> element; *if a parameter is not
found*, it will look up to a parameter defined in the <configuration> element
of each plugin specified in <build>
was (Author: luigiberrettini):
{quote}Only when you run {{mvn pmd:pmd}} directly, your configuration is not
applied - that's because, in that case, the reporting configuration is not used
and you need to configure the m-pmd-p under {{<build>/<plugins>}} as a build
plugin in addition to the reporting plugin.
See also [http://maven.apache.org/guides/mini/guide-configuring-plugins.html]
{quote}
I did read the Maven guide and [[it
says||#using-the-reporting-tag-vs-build-tag]]
[http://maven.apache.org/guides/mini/guide-configuring-plugins.html#using-the-reporting-tag-vs-build-tag]
[]|#using-the-reporting-tag-vs-build-tag]]:
{{mvn aplugin:areportgoal}}
It uses *firstly* the parameters defined in the <configuration> element of each
reporting Plugin specified in the <reporting> element; *if a parameter is not
found*, it will look up to a parameter defined in the <configuration> element
of each plugin specified in <build>
> Configuration is ignored
> ------------------------
>
> Key: MPMD-303
> URL: https://issues.apache.org/jira/browse/MPMD-303
> Project: Maven PMD Plugin
> Issue Type: Bug
> Components: PMD
> Affects Versions: 3.13.0
> Reporter: Luigi Berrettini
> Priority: Critical
> Attachments: poc-mvn-pmd-plugin.zip
>
>
> I configured the reporting plugin this way:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-pmd-plugin</artifactId>
> <version>3.13.0</version>
> <configuration>
> <rulesets>
> <ruleset>/category/java/bestpractices.xml</ruleset>
> <ruleset>/category/java/errorprone.xml</ruleset>
> <ruleset>/category/java/security.xml</ruleset>
> <ruleset>/category/java/performance.xml</ruleset>
> <ruleset>/category/java/multithreading.xml</ruleset>
> <ruleset>/category/java/design.xml</ruleset>
> <ruleset>/category/java/codestyle.xml</ruleset>
> <ruleset>/category/java/documentation.xml</ruleset>
> </rulesets>
> <includeTests>true</includeTests>
> <failurePriority>1</failurePriority>
> <minimumPriority>1</minimumPriority>
> <verbose>true</verbose>
> <showPmdLog>true</showPmdLog>
> <printFailingErrors>true</printFailingErrors>
> <failOnViolation>false</failOnViolation>
> <skip>false</skip>
> <skipEmptyReport>false</skipEmptyReport>
> </configuration>
> </plugin>{noformat}
>
> When I run *_mvn site_* or *_mvn pmd:pmd_* no output is display on the
> console and the default ruleset is used since only
> *_target\pmd\rulesets\maven-pmd-plugin-default.xml_* is generated.
> Looking at the code on GitHub I see the repo contains only the default
> ruleset.
>
> Moreover the build plugin configuration does not support rulesets which would
> be a nice to have.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)