Using Hudson/Building a maven2 project

From Eclipsepedia

Jump to: navigation, search
Hudson Continuous Integration Server
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse Source
Hudson-bust.png Building a Maven project with Hudson











Hudson provides a job type dedicated for Maven2. This job type integrates Hudson deeply with Maven2 and provides the following benefits compared to more generic [free-style software project|Building a software project].

  • Hudson parses Maven POMs to obtain much of the information needed to do its work. As a result, amount of configuration is drastically reduced.
  • Hudson listens to Maven execution and figures out what should be done when on its own. For example, it will automatically record JUnit report when Maven runs the test phase. Or if you run the javadoc goal, Hudson will automatically record javadoc.

Thus mostly you just need to configure SCM information and what goals you'd like to run, and Hudson will figure out everything else.

Maven version

Some users reported a problem using this feature with Maven versions other than 2.0.4. We are particularly interested in any reports on this kind of issues.

Here is one such report: Using Hudson 1.337 on top of Tomcat 6.0.14 on top of MS XP, Maven 2.0.7 would "hang" inside Hudson but not using the command line.  Trying it with Maven 2.0.4 resulted in success inside Hudson, and a resolution of the problem with 2.0.7. 

Automatic build chaining from module dependencies

Hudson reads dependencies of your project from your POM, and if they are also built on Hudson, triggers are set up in such a way that a new build in one of those dependencies will automatically start a new build of your project. Hudson understands all kinds of dependencies in POM. Namely,

  • parent POM
  • <dependencies> section of your project
  • <extensions> section of your project
  • <reporting> section of your project

This process takes versions into account, so you can have multiple versions/branches of your project on the same Hudson and it will correctly determine dependencies.

The Maven Integration Plugin

The Maven 2 project type is contained in the Maven Integration plugin, which is bundled with Hudson. It may show up in your list of plugins available to be upgraded, if you're running any version of Hudson earlier than the current release, but it's recommended that you not upgrade the Maven Integration plugin separately from Hudson itself. While it is technically a plugin, it is developed, tested, and released as part of Hudson cor.