Building Jenkins with Eclipse and m2e plug-in

Yesterday I finally managed to build Jenkins using Eclipse and m2e plug-in. With Eclipse Indigo release came a new version of the Maven plug-in for Eclipse (former M2Eclipse), m2e. Since I started using Eclipse Indigo and this new plug-in I hadn't been able to build Jenkins in Eclipse anymore.

I've been having a terrible fever and thought that it would be a good thing to stop playing Minecraft for a while and find a way to build Jenkins in Eclipse + m2e :-).

1. Maven Plug-ins execution in project life cycle

The first thing I've noticed were the messages regarding the execution of some Maven plug-ins in the project life cycle. m2e delegates the execution of Maven plug-ins to an external executor. As not all Maven plug-ins have an existing executor for m2e you will receive a message similar to "Plugin execution not covered by lifecycle configuration: ...".

The solution for this issue was adding a rule for each plug-in execution. This rule must contain a version or version range and declare whether this plug-in execution must be executed or ignored by m2e. You have two ways of adding these rules. You could a) Google for an example, b) replace group, artifact name and version. Or you could a) open pom.xml and select the tab "pom.xml" (this will open the XML source of your pom.xml) b) go to the line marked with an error in Eclipse, leave your mouse pointer over it and select the option "Permanently mark goal...", choose the parent pom.xml (jenkins/pom.xml) and save all documents.

           <execute />
       <!-- other plug-ins... --->

2. Conflicting Maven repository ids

Another problem building Jenkins in Eclipse was that as there were SNAPSHOT dependencies in jenkins/pom.xml a snapshots repository was added with the id This is the same repository id used in some tutorials to build Jenkins plug-ins. Thus, Maven will ignore this repository, using the one from settings.xml.

The solution for this issue was changing the repository id from to

<repository><!-- only until we release ant and javadoc plugins -->

3. maven-localizer-plugin

This issue was related to the generation of the localization Java classes. maven-localizer-plugin reads properties files and generates Java classes with the text in a locale to be used by the plug-in. But sometimes Eclipse doesn't include all the source folders generated by this plug-in, causing the project to have compilation errors.

The solution for this issue was to add the generated sources manually in jenkins/pom.xml under the build-helper-maven-plugin plug-in configuration.


Removing remaining Eclipse errors and warnings

Matthieu Vincent managed to overcome other Eclipse errors and warnings with the following steps:

Now you can follow the instructions in Jenkins Wiki for building Jenkins and have fun in your Eclipse. There still seems to have few issues to be solved. I can't see the version number in the footer, and the default plug-ins are missing. Time to go back to Minecraft now :D!


Categories: Blog

Tags: Java, Jenkins