0

I would like to run my customized rule set which is in my local disk D:\rulesets\java. I am using maven to build my application. I put the below entry in maven POM.xml

<reporting>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
            <rulesets>
                <ruleset>D:\rulesets\java\basic.xml</ruleset>
                <ruleset>D:\rulesets\java\braces.xml</ruleset>
                <ruleset>D:\rulesets\java\clone.xml</ruleset>
                <ruleset>D:\rulesets\java\codesize.xml</ruleset>
            </rulesets>
        </configuration>
    </plugin>
</plugins>

When I run my PMD report (mvn pmd:pmd) it's not taking my customized pmd ruleset defined in pom file. How to solve this issue ?

Thanks in advance.

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
Mohan
  • 3,893
  • 9
  • 33
  • 42
  • 2
    I don't have the actual answer for you, but I will suggest not to have those rules stored outside control of Maven. It is simply making your Maven project difficult to maintain in the future. Anyway, I bet you can change the ruleset to `/java/FILENAME.xml`, and add `D:/rulesets` as a system-scope dependency for this plugin. However, this is still not a good solution even it works – Adrian Shum Jul 16 '12 at 08:03
  • I checked [official plugin site](http://maven.apache.org/plugins/maven-pmd-plugin/examples/usingRuleSets.html) and all is OK. Maybe problem is with content of your rules? Please add one by one and check again. – Andrzej Jozwik Jul 17 '12 at 06:57

0 Answers0