Skip to end of metadata
Go to start of metadata

View PMD Plug-in on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

This plugin generates the trend report for PMD, an open source static code analysis program. 

Installation Requirements

This plug-in requires the utility plug-in "analysis-core" (called "Static Analysis Utilities" in the update manager). Please ensure that the latest version of this plug-in is also installed.


(lightbulb) This plug-in is supported by the Static Analysis Collector plug-in that collects different analysis results and shows the results in aggregated trend graphs. Additionally, health reporting and build stability is also based on the aggregated results.

The PMD plug-in scans for pmd.xml files in the build workspace and reports the number of warnings found. This plug-in is part of the suite of static code analysis plug-ins that are documented on a separate WIKI page.

The following features are provided by this plug-in:

  • Configuration of the files to scan after a build.
  • Build summary showing the new and fixed warnings of a build
  • Several trend reports showing the number of warnings per build
  • Overview of the found warnings per module, package, category, or type
    • Parsing of Maven pom.xml or Ant build.xml configuration files to obtain the module or project name
    • Parsing of Java files to obtain the package or name space name
  • Detail reports of the found warnings optionally filtered by severity (or new and fixed)
    • Short messages is read from the report file
    • Detailed description is read from the PMD library
  • Colored HTML display of the corresponding source file and warning lines:
    • Direct link to the warning line
    • Highlighting of single lines as well as line ranges
    • Highlighting of multiple line ranges per warning (different color for primary range)
    • Tool tip describing the warning message
  • Failure threshold to mark a build as unstable
  • Configurable project health support
  • Works with the freestyle and native m2 build option (activated on goal pmd:pmd or site)
  • Remote API to export the build quality and found warnings
  • Several tokens to simplify post processing of the results
  • Localization available for: DE, JA (Please help to localize PMD for your locale!)

The current release is available in the download section. This plug-in is developed and maintained by Ullrich Hafner. Please use the mailing lists or issue tracker to ask questions, create feature request or bug reports, since I don't read the comment section on this page regularly.


Release 3.50

Release 3.49

  • Compute author and commit information using the Git blame command. Show report of warnings by user on the job page and in the dashboard view. ( JENKINS-6748 - Analysis of Checkstyle Warnings per User RESOLVED )

Release 3.48

  • Upgrade of PMD to 5.7.0
  • JENKINS-43569 - Getting issue details... STATUS

Release 3.47

  • Added a new symbol for pipelines: pmd

Release 3.46

Release 3.45

Release 3.44

  • Don't alter SAX environment variable anymore (JENKINS-27548)
  • Fixed resolving of files with relative paths in workspace (JENKINS-32150)

Release 3.43

  • Make maven plug-in mandatory since otherwise class loading exceptions will sometimes destroy the build configuration (JENKINS-21268, JENKINS-14727)

Release 3.42

  • Added support for workflow plug-in (Thanks to Antonio Muñiz and Manuel Recena for their PRs)
  • Fixed links in detail page of trend reports (JENKINS-29900)

Release 3.40.

  • Upgrade of messages to PMD 5.2.3.

Release 3.39

Release 3.37

  • Added a view column that shows the number of warnings in a job

Release 3.36

  • Make dependency to ant-plugin optional

Release 3.35

  • Added some more fields that are exposed via the REST API (JENKINS-17767, thanks to Mihail Menev, Johann Vierthaler for the patch!)
  • Added Traditional Chinese translations (thanks to Pei-Tang Huang!)
  • Added system configuration option to disable console logging of all static analysis plug-ins (JENKINS-15246, thanks to Sebastian Seidl for the patch!)
  • Added system configuration option to fail a build when one of the static analysis plug-ins fails parsing its input (JENKINS-17663, thanks to Mihail Menev and Johann Vierthaler for the patch)
  • Fixed broken encoding handling in maven jobs (JENKINS-17657, thanks to André Lehmann!)

Release 3.34

  • Show more details in the fixed warnings view (JENKINS-15959)
  • Aggregate the maven parent module results in failed builds when the failure is caused by a threshold being hit (JENKINS-15324, JENKINS-12342)
  • Optimized http requests for static resources in the analysis plugins (JENKINS-16571)
  • Fixed missing build overview in maven jobs (JENKINS-16518)
  • Always use Xerces when parsing XML files (JENKINS-15613)
  • Read pom.xml to obtain path of output files in maven jobs (JENKINS-16250)
  • Show error message as file content if the source files could not be transferred to the master (JENKINS-16222)

Release 3.33

Release 3.32

Release 3.31

Release 3.30

  • Added xerces dependency if slave has no xerces in classpath (JENKINS-14509)

Release 3.29

  • Show all values of difference graph

Release 3.28

  • Added hyperlinks to build summary if threshold is exceeded (JENKINS-12424)

Release 3.27

  • Added option to filter projects with zero warnings in the warnings dashboard portlet (JENKINS-12984)
  • Center the affected source line in source view (JENKINS-13491)
  • Fixed incompatibility of detail tabs with new bread crumb view (JENKINS-13532)

Release 3.26

  • Added a new portlet that shows the warning totals as a line graph

Release 3.25

  • Show build result threshold evaluation information in build summary (JENKINS-12424)
  • Support for column ranges in warnings (JENKINS-12801)
  • Fixed plug-in configuration if used in conjunction with flexible-publisher plug-in (JENKINS-12182, JENKINS-8185)
  • Upgrade to PMD 4.2.6

Release 3.24

  • Fixed initialization problem when configuring the plug-in for maven jobs. (JENKINS-12075)

Release 3.23

  • Fixed NPE while configuring a graph with no builds yet (JENKINS-12045)
  • Group warnings by relative path if the associated language has no package or namespace concept (JENKINS-11846)
  • Allow skipping of calculating "new" issues (JENKINS-11761)
  • Fixed display of 'Use delta for new warnings' option (JENKINS-11758)
  • Ignore 'new warnings' threshold in the first build (JENKINS-11718)

Release 3.22

  • Fixed enlarge link for trend graphs (JENKINS-11324)
  • Fixed visibility of 'enable trend graph' link
  • Fixed reading of results if analysis is invoked during 'mvn site' (JENKINS-10820)

Release 3.21

  • Ignore failed builds when evaluating the build history in trend graphs and new warnings calculation (JENKINS-10682)
  • Added OSGi bundle detection when grouping warnings by module (JENKINS-10681)
  • Use the path as a replacement for the package grouping for all warnings that are not from Java or C# files (issue 2)

Release 3.20

Release 3.19

  • Added new tokens for token macro plug-in (JENKINS-10027): now tokens PMD_NEW, PMD_FIXED, PMD_COUNT and PMD_RESULT are available.

Release 3.18

Release 3.17

  • Fixed display of trend graphs for maven jobs (report)

Release 3.16

  • Fixed health reporting and build failure/unstable thresholds for maven project type (JENKINS-4912, JENKINS-3514)
  • Fixed broken detail views when using a reverse proxy (JENKINS-3410, thanks to Benjamin Cabé for the fix)
  • Show the reference build that is used to compute new and fixed warnings (when build thresholds are set)
  • Improved logging statements when build is executed on a slave

Release 3.15

  • Added configuration option to enable automatic project and module name detection by reading all Ant project.xml and Maven pom.xml files (JENKINS-8915, JENKINS-9090)
  • Added preliminary support for the Token Macro Plugin: PMD_COUNT expands to the number of PMD warnings and PMD_RESULT expands to the plug-in build result (stable, unstable, failed)

Release 3.14

  • Fixed missing dependency to Hudson/Jenkins 1.395 (JENKINS-8509)

Release 3.13

  • Jenkins update to links and documentation
  • Show progress text while dashboard portlet graphs are created

Release 3.12

  • Added support for multi-configuration projects (JENKINS-6772)

Release 3.11

  • Fixed sorting of date labels of dashboard trend graphs (JENKINS-8476)
  • Fixed evaluation of builds that will be considered in the dashboard trend graph (JENKINS-8283)

Release 3.10

  • Added build status thresholds for each warning priority (JENKINS-3561)

Release 3.9

  • Fixed computation of module names for maven projects (JENKINS-6768)
  • Don't report an error message if a maven module does not contain a report file (JENKINS-6895)
  • Fixed ant links (JENKINS-6862)

Release 3.8

Release 3.7

Release 3.6

  • Fixed broken links to project page and overview image (JENKINS-6417)

Release 3.5

  • Added trend graph portlets for the dashboard view
  • Added option to start the plug-in even for failed builds (JENKINS-6117)
  • Added 'enlarge' link for trend graphs that shows a detail page with the graph
  • Fixed ordering of warnings in detail views (JENKINS-6132)
  • Fixed warning distribution graph in files detail view (JENKINS-6139)

Release 3.4

Release 3.3

  • New warnings computation is now based on the current build and the reference build (i.e., the last successful build, see JENKINS-5147)
  • Visualized plug-in build status (based on the healthiness thresholds)
  • Added high scores for successful builds
  • Don't show project action if there are no warnings (JENKINS-5473)
  • Don't show trend graph configuration on job creation (JENKINS-5294)
  • Improved remote API, now the warning keys are also exposed (JENKINS-5195)

Release 3.2

Release 3.1

  • Fixed trend report link if there are no results available yet (JENKINS-5156)
  • Fixed preview of trend reports
  • Added dependency to Hudson 1.337 due to a class loader bug in previous versions (JENKINS-4993)

Release 3.0

  • Extracted common code of the static code analysis plug-ins into a new utility plug-in "analysis-core"
  • Several bug fixes and small improvements

Release 1.x - 2.x ChangeLog


  1. Hi,

    I can't find 3.0 release on the download Section.


    1. Seems that my release process has a bug somewhere. Can't you use the update manager?

      1. No, it's not possible. Hudson isinstaled on a server and for security it don't have acces to web.(wink)

  2. Hello --

    I've constructed a Hudson job to run a PMD static analysis on a medium-is size code base (around 1000 source files).  The xml generated is 138k, 1300 lines so not big.  Using the latest version of your PMD plugin I configure the job to publish the results.  The build of the PMD results takes 7m42s, then the job attempts to publish the results.  It never comes back.  I've let the job run overnight just to see what would happen and it was running in the morning ... over 12 hours ... so I'm figuring it's not going to ever finish.  I see no memory errors in the catalina logs or anything out of the ordinary for that matter.  I've given the ant plenty of memory to play with (2G) for this job, so I don't think that's at issue.  Other jobs come and go during this time so Hudson is still in a good state.  Worse yet I cannot kill the running job from within Hudson either.  Is that a stuck thread?  I have to stop Hudson in order to purge the job.  The tail of the build log for the PMD job looks like this:

         [java] BUILD SUCCESSFUL
         [java] Total time: 4 minutes 11 seconds
    Total time: 7 minutes 42 seconds
    [PMD] Collecting PMD analysis files...

    I run a PMD html formatter on the same xml which takes several seconds to complete, but completes non the less.  Can you explain to me how the PMD plugin is attempting to publish the analysis results?  Is it using a PMD formatter or have you crafted one of your own?

    I've resorted to running my own html formatter in the build on the analysis results and am using the html publisher plugin to get at the results so I'm not blocked, but I would however like to see the PMD plugin results.  Anyways, if I can help further troubleshoot my problem or if you need anything from me to help you understand what's going on, let me know.


    1. Can you please create an issue and attach the PMD result file?

  3. Hello,

    Might have come accross a feature in relation to softlinks when searching for pmd results files.

    I can create a soft link in workspace root to point to another location on disk and the PMD plugin will access this location and search for pmd result files. This works if the result files can be found in a 'directory' in the other location. If however the pmd result files are stored in a third location on disk which is accessed by a softlink from the second location on disk the pmd plugin will not find the results. To me this seems inconsistent as the plugin is already searching softlinks but will not search more than 1 level. Maybe this is a good thing and I can refactor my build script to remove the need for softlinks but just checking if this is the desired way of working.

    So for

    ~/.jenkins/jobs/MyJob/workspace/output@ -> /view/andy_build/vobs/product/output



    if pmd is an actual directory all works fine but if pmd is a softlink (e.g. /view/andy_build/vobs/product/output/pmd@ -> /view/andy_build/vobs/product/java/results/pmd) it fails.

    All the best.

    1. Hmm, I'm just using the ant libraries to find files and normal Java IO to read these files. I don't see how this could be changed easily. Is you build running on a slave?

      1. I suppose it could be any number of causes (e.g. in my environment) but one to be aware of anyhow.

        I've refactored the build scripts to do away with the nested softlinks so all working perfect now. Just one softlink under workspace root and all files are found.

        Go raibh maith agat.

  4. Hi,(สวัสดีครับ)

    PMD project source code on Eclipse,I want to make a Final Topic.

    I will apply PMD Eclipse plugin for refactoring long method bad smell.

    Thank you,(ขอบคุณครับ)

  5. Hello every one, I need some help on PMD plugin development.
    I want to clone PMD plugin in order that It can show two trend reports for two different PMD
    results in one job! Now I have cloned one with its archive ID called 'cloned-pmd',
    and I changed src package from 'com.hudson.pmd.**' to 'com.hudson.clonedpmd.**',
    and I also change the project action name from 'PMD Warnings' to 'PMD Warnings II'.
    and the report xml file name was changed too.
    After that I built the cloned plugin successfully and fininshed installation in jenkins plugin management page,

    Then I found that the cloned PMD plugin could be added in the job config page successfully,
    however it only displays origional PMD plugin menu with the name 'PMD Warnings' on left side tab,
    my cloned PMD plugin could not show. I have checked that no errors or warnings were printed out
    on the console.
    Did I miss any places to modify in the source code? I will be appreciate for any reply, thanks!

  6. Hello,

    I use PMD plugin 3.45 with PMD with the latest 5.5.1.
    At the end, PMD plugin get the result but during this step, there is an error.
    PMD plugin can't parse xml Octet 1 de la séquence UTF-8 à 1 octets non valide.

    The latest PMD version which works with 3.45 is 5.4.0.

    Do you know this issue?

    Thanks you,

  7. This plug-in provides utilities for the static code analysis plug-ins.
    This plug-in collects the PMD analysis results of the project modules and visualizes the found warnings.
    This plug-in adds reusable macro expansion capability for other plug-ins to use.
    This plug-in provides, for better and for worse, a deep integration of Jenkins and Maven: Automatic triggers between projects depending on SNAPSHOTs, automated configuration of various Jenkins publishers (Junit, ...).
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.8:pmd (default-cli) on project SINGLE_HUB_POM: Execution default-cli of goal org.apache.maven.plugins:maven-pmd-plugin:3.8:pmd failed: Unable to load the mojo 'pmd' in the plugin 'org.apache.maven.plugins:maven-pmd-plugin:3.8'. A required class is missing: org/apache/maven/reporting/AbstractMavenReport [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.apache.maven.plugins:maven-pmd-plugin:3.8 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/home/.m2/org/apache/maven/plugins/maven-pmd-plugin/3.8/maven-pmd-plugin-3.8.jar [ERROR] urls[1] = file:/home/.m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR] [ERROR] -----------------------------------------------------: org.apache.maven.reporting.AbstractMavenReport [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1]
    1. What is this? A bug report? A question??? This is a maven error unrelated to the plugin.

Write a comment…