Building a Build Server – Finding Duplicated Code Blocks in your Source

JetBrains, the company behind ReSharper, has a command-line tool package with some of the ReSharper features too. It is a free package to integrate quality analysis into continuous integration systems and can be downloaded from JetBrains’ ReSharper Command Line Tools page.

In this article, we are going to integrate the dupFinder into the Jenkins build process. The installation process uses wget and unzip, these tools have been setup in article Building a Build Server – Installing NAnt.

Installing ReSharper Command Line Tools

Open the Cygwin terminal and execute the following commands:

mkdir /tmp/ReSharperCLT

cd /tmp/ReSharperCLT




cd /cygdrive/c

mv /tmp/ReSharperCLT /cygdrive/c

icacls ReShaperCLT /T /Q /C /RESET

Installing necessary plugins

From the main page of Jenkins, go to Manage Jenkins / Manage Plugins and install the plugin DRY Plug-in from the Available tab.

Integrating ReSharper Command Line Tools into Jenkins

To try out this tool, we are going to use the repository at

The test build project has the following build configuration:

Source Code Management

Use Git source code management with


Repository URL


Branches to build

Branch specifier (blank for ‘any’)


Repository browser:



Execute Windows batch command


C:\ReSharperCLT\dupfinder.exe –output=DupFinderReport.xml CodeDuplicates.sln

Post-build Actions

Publish duplicate code analysis results

Duplicate code results


High priority threshold


Normal priority threshold



Next time, we are going to explore how to integrate the code inspection checker into the build process. You can connect with me on LinkedIn or Twitter. Share if you found this article useful.

By subscribing to the email list, you will be notified about new posts.
No comments yet.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress. Designed by WooThemes