DRY Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID dry Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
2.43 (archives)
Nov 28, 2015
maven-plugin (version:2.9)
matrix-project (version:1.2.1)
analysis-core (version:1.75)
dashboard-view (version:2.9.4, optional)
token-macro (version:1.10, optional)
Source Code
Issue Tracking
Pull Requests
Open Issues
Pull Requests
Ulli Hafner (id: drulli)
Usage Installations 2014-Nov 7106
2014-Dec 7028
2015-Jan 7405
2015-Feb 7409
2015-Mar 7705
2015-Apr 7539
2015-May 7334
2015-Jun 7599
2015-Jul 7666
2015-Aug 7444
2015-Sep 7408
2015-Oct 7383

This plugin generates the trend report for duplicate code checkers like CPD or Simian.

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.


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 DRY principle (don't repeat yourself) of the pragmatic programmers states that every piece of system knowledge should have one authoritative, unambiguous representation. The dry plug-in helps you to adhere to this principle by showing you the duplicate code blocks in your project.

This plug-in does not scan for duplicate code by itself; it only shows the results of duplicate code checker tools. Currently CPD and Simian are supported. 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 name
  • Detail reports of the found warnings optionally filtered by severity (or new and fixed)
  • 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 options (activated on goal pmd:cpd 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 DRY 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.


You can support the development of this open source plug-in by buying my Android game Inca Trails in Google Play!

Release 2.43

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

Release 2.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 2.41

  • Reverted XML escaping of messages (JENKINS-25511, JENKINS-17309)
  • Added option to use previous build as reference build when calculating new and fixed warnings (JENKINS-13458, thanks to Tom Saunders for the pull request)

Release 2.42

  • Added support for latest CPD version that generates files with user defined encoding ([issue@22356])

Release 2.39

  • Added support for Resharper commandline tools (JENKINS-21596, thanks to Rafał Jasica for the pull request)
  • Reset SAX parser property after processing (JENKINS-20070)
  • Fixed icon URLs (JENKINS-21510)

Release 2.38

Release 2.37

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

Release 2.36

  • Make dependency to ant-plugin optional

Release 2.35

  • Use UTF-8 as default encoding of XML files
  • 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 2.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 2.33

Release 2.32

Release 2.31

Release 2.30

Release 2.29

  • Reduce memory footprint of plug-in (thanks to Kohsuke for the patches)
  • Upgrade to YUI 2.9 (support for new bread crumbs and context menus: JENKINS-13532, thanks to OHTAKE Tomohiro for the patch)

Release 2.28

  • Show all values of difference graph

Release 2.27

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

Release 2.26

  • 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 2.25

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

Release 2.24

Release 2.23

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

Release 2.22

  • 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 2.21

  • 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 2.20

  • 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 2.19

  • Added new tokens for token macro plug-in (JENKINS-10027): now tokens DRY_NEW, DRY_FIXED, DRY_COUNT and DRY_RESULT are available.

Release 2.18

Release 2.17

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

Release 2.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 2.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: DRY_COUNT expands to the number of DRY warnings and DRY_RESULT expands to the plug-in build result (stable, unstable, failed)

Release 2.14

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

Release 2.13

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

Release 2.12

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

Release 2.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 2.10

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

Release 2.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 2.8

  • Fixed naming of maven modules (JENKINS-6513)
  • Group files by path if there is no package or namespace found (JENKINS-6698)
  • Show path of the files with duplicate code (JENKINS-6683)

Release 2.7

Release 2.6

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

Release 2.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)
  • Make thresholds for high and normal warnings configurable (JENKINS-6108)
  • Show affected files in all detail views (JENKINS-6277, JENKINS-5034)

Release 2.4

Release 2.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 2.2

  • Added support for the new plug-in [Static Analysis Collector plug-in] to provide combined trend graphs and health reporting (JENKINS-3320)
  • Improved remote API, now the warnings are also exposed (JENKINS-5195)

Release 2.1

  • Fixed visualization of the warning details (JENKINS-5034)
  • 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 2.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 ChangeLog


plugin-maven plugin-maven Delete
plugin-report plugin-report Delete
supports-dashboard-view supports-dashboard-view Delete
token-producer token-producer Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 07, 2009

    Radek says:

    Thanks for that, it will be very useful in my company. I really love such repor...

    Thanks for that, it will be very useful in my company.

    I really love such reports plugins, however this plugin seems to cause a problem within displaying hudson job configuration view. Ff's firebug says there are too much recursion of following javascript line.

    window.onload = function() { if(oldOnLoadFordryDefaultEncoding) oldOnLoadFordryDefaultEncoding();

    That problem refers also latest versions of checkstyle, pmd, findbugs and varnings plugins.

    1. Jan 08, 2009

      Ulli Hafner says:

      This is a know problem due if the plug-ins are used together with the build-prom...

      This is a know problem due if the plug-ins are used together with the build-promotion plug-in: see JENKINS-2781

  2. Dec 07, 2009

    resvoe - says:

    The tool is very usefull and looks better than the violations report. But with ...

    The tool is very usefull and looks better than the violations report.

    But with version 2.0 I can no more see, where the duplication comes from. Knowing that some code is duplicated is helpfull but for legacy applications with lots of duplicated code it helps to know which files to compare.

    1. Dec 08, 2009

      Ulli Hafner says:

      Hmm, that seems to be a bug. Can you please create a new issue in our Jira track...

      Hmm, that seems to be a bug. Can you please create a new issue in our Jira tracker?

      1. Dec 11, 2009

        resvoe - says:

        done issue #5034
  3. Sep 26, 2011

    Felix Petriconi says:

    Note: Under Windows Server 2003 / 7 x64 the DRY plugin prefers the XML-report i...


    Under Windows Server 2003 / 7 x64 the DRY plugin prefers the XML-report in ISO-8859-1 format and not in CP-1252. So set the encoding of cpd to this format.

    With Ant and C++ code as executor this is the command:

     <cpd minimumTokenCount="100" language="cpp" encoding="ISO-8859-1" format="xml" outputfile="report.xml">
  4. Jan 10, 2013

    Eric Brito says:

    Something is causing my build to fail. This started after I installed DRY. her...

    Something is causing my build to fail.

    This started after I installed DRY.

    here's the console output:[DRY] Collecting duplicate code analysis files...
    [DRY] Finding all files that match the pattern simian.xml
    [DRY] Parsing 1 files in C:\Jenkins\jobs\QiBuilder\workspace
    [DRY] Successfully parsed file C:\Jenkins\jobs\QiBuilder\workspace\simian.xml of module with 10404 warnings.

    FATAL: null
    at sun.nio.cs.UTF_8.updatePositions(Unknown Source)
    at sun.nio.cs.UTF_8$Encoder.encodeArrayLoop(Unknown Source)
    at sun.nio.cs.UTF_8$Encoder.encodeLoop(Unknown Source)
    at java.nio.charset.CharsetEncoder.encode(Unknown Source)
    at sun.nio.cs.StreamEncoder.implWrite(Unknown Source)
    at sun.nio.cs.StreamEncoder.write(Unknown Source)
    at java.io.OutputStreamWriter.write(Unknown Source)
    at java.io.BufferedWriter.flushBuffer(Unknown Source)
    at java.io.BufferedWriter.flush(Unknown Source)
    at hudson.util.AtomicFileWriter.flush(AtomicFileWriter.java:90)(removed the rest of the 1000+ lines)
    I've created an issue with the XML file included: https://issues.jenkins-ci.org/browse/JENKINS-16298

  5. Mar 02, 2015

    Jamil Ahmed says:

    Is there a way to send out notifications of "new" instances of code duplication?...

    Is there a way to send out notifications of "new" instances of code duplication? I noticed there's a new tab on the page, and I wanted to extract that information to put into an email notification. However, there is no such information in the XML file generated by phpcpd, so I'm wondering how you calculate new violations.

  6. Sep 17

    Chris Pepper says:

    There is a problem with the plugins "Task Scanner" and DRY. When I include one o...

    There is a problem with the plugins "Task Scanner" and DRY. When I include one of these in as a post-process step in a MultiJob task, the build does not generate a build.xml file. The result is that Jenkins reloads the build disappears from the list.

  7. Sep 17

    Chris Pepper says:

    Hi, there is a problem with the "Task Scanner" and the DRY plugins. When I inc...


    there is a problem with the "Task Scanner" and the DRY plugins. When I include one of these as a post-build step in a MultiJob job, the build does not generate a build.xml file. The result is that when Jenkins is reloaded from file the build disappears from the build list.