Reputation: 81
I want to generate PMD Reports using maven in .csv and .xml format. I edited my pom.xml as below:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.1</version>
<configuration>
<formats>
<format>csv</format>
<format>xml</format>
</formats>
<rulesets>
<ruleset>../PMD_RuleSet/PMDRules.xml</ruleset>
</rulesets>
</configuration>
</plugin>
Please let me know if I am following the correct configuration. Thanks
Upvotes: 0
Views: 763
Reputation: 2475
<formats> not exist :
Try:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.1</version>
<configuration>
<rulesets>
<ruleset>../PMD_RuleSet/PMDRules.xml</ruleset>
</rulesets>
</configuration>
</plugin>
Execute : mvn clean pmd:pmd -Dformat=csv
Execute : mvn clean pmd:pmd -Dformat=xml
Upvotes: 1
Reputation: 2475
Try this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.5</version>
<executions>
<execution>
<id>default-pmd</id>
<goals>
<goal>pmd</goal>
</goals>
<configuration>
<format>xml</format>
</configuration>
</execution>
<execution>
<id>format_csv</id>
<goals>
<goal>pmd or check or cpd-check</goal>
</goals>
<configuration>
<format>csv</format>
</configuration>
</execution>
</executions>
</plugin>
Upvotes: 0