Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

I still don't know how to use the PMD-Jenkins plugin to generate and show my results. Does no one help me? I have been confused for 5 days.

How to generate and show the PMD result in Jenkins?

1 Answer

0 votes
by (50.2k points)

PMD Jenkins plugin is only displaying the PMD check results. You need to run PMD using Maven as part of your build triggered by Jenkins

Then PMD-Jenkins will know where to pick up the results and publish them for you. To get the results you will need to add this code to your pom.xml and execute the according to target in Jenkins

<reporting>

    <plugins>

        <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-pmd-plugin</artifactId>

            <version>2.7.1</version>

            <configuration>

                <linkXRef>false</linkXRef>

                <targetJdk>1.6</targetJdk>

                <rulesets>

                    <ruleset>/rulesets/basic.xml</ruleset>

                </rulesets>

            </configuration>

        </plugin>

    </plugins>

</reporting>

Browse Categories

...