The Maven build task now supports PMD analysis out of the box

Jean-Marc Prieur

Simple Java static analysis tools

In addition to working on the SonarQube integration, we received feedback from some of you that you would like the Maven and Gradle tasks to perform static analysis using common Java tools such as PMD, CheckStyle, and FindBugs. These tools are also supported though SonarQube plug-ins, and most of their rules are also part of the SonarQube Java plug-in, but that requires installing a SonarQube server. Therefore, we have also been working on supporting simple static analysis tools for Java, beginning with PMD in the Maven build task.

PMD Analysis with Maven

You can now request a PMD analysis in the Maven build task using the new “Run PMD Analysis” checkbox.

clip_image002

This option enables Maven builds to perform PMD static analysis, for which the build summary will report the number of issues found by PMD.

clip_image003

Detailed issue logs are available under the build artifact tab of the build summary. If you analyze a multi-module Maven project, the results are split by module.

clip_image004

This works even when the main Maven pom file references multiple pom files, in which case there will be several artifacts.

Limitations, Feedback and Troubleshooting

Currently this feature works only in Team Services with the Linux agent. It’s not yet available with the hosted agent or with Windows based agents. – That it is not yet available on-premises, but will be in the next major version of TFS.

Also if you want to further customize the analysis, you would need to change their pom file to defined relevant options, such as rule sets.

We’d like to hear from you, Please Raise issues and suggestions on the issues tab of the VSTS task repository in GitHub: https://github.com/microsoft/vsts-tasks/issues

0 comments

Discussion is closed.

Feedback usabilla icon