Standard Practice for Continuous Integration of Maven Multimode Projects

I checked around and could not find a good answer to this question:

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

  • Our continuous integration server (TeamCity, in this case, but I used to use others, and they have the same problem) point to the aggregator POM file and simply build everything at once
  • Set up our continuous integration server on every single module

Is there a standard, preferred practice for this? I checked Stack Overflow, Google's Continuous Integration Book and didn't find anything, but maybe I missed it.

+7
maven-2 continuous-integration
source share
2 answers

Standard practice with Hudson, at least, is your first option. Firstly, your design may not work very well if all projects are not in the reactor together. For another, trying to make them separate assemblies, you put you in control of snapshots. If someone in the middle changes, and you try to build just that, maven will go look for its dependencies in the form of snapshots. What he will receive will depend on the order of creation of other projects and the publication of pictures.

If you have so many projects or such unrelated projects that their creation is a problem, I suggest you consider the possibility of dissolving. Make a parent separate, released project, for each of them (or each subgroup) of the Trunk / tags / Branches structure and make them depend on releases, not on snapshots.

+6
source share

Ideal practice would be to run a reactor assembly to create only modules containing the changes (with the --projects option) and for modules that depend on them (with the --also-make-dependents option).

But TC does not yet support an equivalent function (check TC 5 EA: Maven 2 dependency triggers do not work ... ) and so it’s good practice to start a full reactor build (you don’t want the invidual module to block modules depending on him, without warning, you want to synchronize the consistent sets of SNAPSHOTS).

+3
source share

All Articles