Can't use custom ruleset in maven-pmd-plugin 5.0.2

后端 未结 1 1421
梦毁少年i
梦毁少年i 2021-01-12 19:42

I want maven-pmd-plugin to include rulesets that I specify and exclude some rules (specifically, UselessParentheses)

Just like described in documentation, I placed t

相关标签:
1条回答
  • 2021-01-12 20:10

    You've configured the maven-pmd-plugin as a reporting which is

    Reporting contains the elements that correspond specifically for the site generation phase. Certain Maven plugins can generate reports defined and configured under the reporting element.

    This means you should execute with the following command:-

    mvn clean site
    

    If you would like to execute as you mention, please copy your configure to builds, e.g.

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <rulesets>
                        <ruleset>/home/ubuntu/ruleset.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

    Then when you execute the

    mvn clean jxr:jxr pmd:check
    

    The result should be as your expected. You can find further about Maven Pom, here.

    I hope this may help.

    Regards,

    Charlee Ch.

    0 讨论(0)
提交回复
热议问题