Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard Practice for Continuous Integration of Maven Multi-module projects

I checked around, and couldn't find a good answer to this:

We have a multi-module Maven project which we want to continuously integrate. We thought of two strategies for handling this:

  • Have our continuous integration server (TeamCity, in this case, but I've used others before and they seem to have the same issue) point to the aggregator POM file, and just build everything at once
  • Have our continuous integration server point at each individual module

Is there a standard, preferred practice for this? I've checked Stack Overflow, Google, the Continuous Integration book, and did not find anything, but maybe I missed it.

like image 745
James Kingsbery Avatar asked May 14 '10 21:05

James Kingsbery


People also ask

Why continuous integration service is used with Maven?

The main benefit of Continuous Integration is the ability to flag errors as they are introduced into a system instead of waiting multiple days for test failures and critical errors to be identified during the QA cycle.

What is Maven Multi-Module project?

A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.


1 Answers

Standard practice with Hudson, at least, is your first option. For one thing, in maven, your build may not work very well if all the projects are not in the reactor together. For another, trying to make them separate builds is going to put you in snapshot-management heck. If one in the middle changes, and you try to build just it, maven will go looking for its dependencies as snapshots. What it gets will depend on the order in which other projects build, and whether you publish snapshots.

If you have so many projects, or such unrelated projects, that building them all is a problem, then I suggest that you need to consider dis-aggregation. Make the parent a separate, released, project, give each of them (or each subgroup of them) a Trunk/Tags/Branches structure, and make them depend on releases, not snapshots.

like image 101
bmargulies Avatar answered Nov 14 '22 23:11

bmargulies