Setting up Eclipse to build Jenkins

Skip to end of metadata
Go to start of metadata

Audience: Jenkins developers who use Eclipse as their IDE
Goal: To be able to modify Jenkins core source code, and run/debug it within Tomcat.
Author: Brian Westrich (bw@mcwest.com)
Prerequisites: You have already completed the steps currently at Building Jenkins, up to and including running "mvn ... eclipse:eclipse".

Make sure you're using Java 6

Jenkins does not compile on Java5.

Window, Preferences...

Make sure JDK6 is present and checked.


Set your M2_REPO variable

Window, Preferences....



Click New, then specify your M2_REPO location, for example:



Import the modules you want to work with

From "File" > "Import" > "Existing projects into workspace"

Even if you are modifying just one module, you must import all of them into Eclipse as they depend on each other.

Other tips

Setting up Jenkins to run as web app within tomcat/eclipse (using eclipse 3.3, tomcat 6.0, sysdeo tomcat plugin):

  • Add the plugin project you are currently working on into Tomcat's classpath using the Sysdeo plugin (Preferences, Tomcat, Advanced, ...)
  • Download a recent stable Jenkins war.
  • Copy war to tomcat webapps.
  • Start tomcat. This will explode the war into the tomcat webapps directory (needed for subsequent step).
  • Limitation: This setup does not deploy any non-Java artifacts to the web application. If you update any of these (e.g. html files), you'll need to manually copy these to the exploded directories in the tomcat webapps directory.

If you are changing multiple modules, the most reliable way to have the correct version appear first on the tomcat classpath is to add the imported version of the module to the classpath of the plugin you're debugging, then only add the plugin project to Tomcat's classpath. For example, this shows the Jenkins-core project added to the build path of the perforce plugin.


After you add the jenkins-core project to the classpath, use the 'Order and Export' tab to move the jenkins-core project before the jar version (in M2_REPO) of jenkins-core. Also, you must check the checkbox to the left of jenkins-core, otherwise Tomcat will not be able to load any of the classes in jenkins-core.



Use Mylyn and the Jenkins issue tracker

It is possible to configure Mylyn so it will connect to the Jenkins issue tracker. To be able to connect to the tracker you need to install the CollabNet Desktop plugin.

Task repository

When the plugin has been installed, create a new Task repository with the following settings:

Task query

To create a query to the issue tracker

  1. Create a new Mylyn query
  2. Select the newly create task repository
  3. Select "Create query using form"
  4. Enter a name for the query
  5. Set the component to Jenkins
  6. Configure the query
    !
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment