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.
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.