How to configure Jenkins for a multi-module maven project
Add another aggregator. Place modulA and parentModul in the same directory and one level above them, simply add another pom like this:
aggregator/|- modulA/| |- pom.xml|- parentModul/| |- modulB/| | |- pom.xml| |- pom.xml|- pom.xml
In the aggregator/pom.xml define a modules section as follows:
<project ...> <modules> <module>modulA</module> <module>parentModul</module> </modules></project>
One solution would be to use SVN Externals to assemble sane Maven project workspace from insane SVN structure even accross different svn servers. Using svn external is not an ideal solution as it will cause problems with maven release plugin and with CI's SCM polling in certain configuration. They tell you : "You should not use svn externals" as makes life more difficult. But so do leg cast and crutches but when you have broken leg (or svn structure that is fubar) you really do not mind the inconvenience.
There several ways of doing this, depending on your SVN structure and desired workspace structure:
svn co modulA
cd modulA
svn propedit svn:externals .
NB: Note the (curdir) dot at the end of line!- add following line: parentModul http://path.to.your.svn.location.of.parentModul
- svn ci -m "added externals for parent"
- svn up
and the svn retrieves (and commits) you code to following workspace structure
modulA/| |- pom.xmlparentModul/|- modulB/| |- pom.xml|- pom.xmlpom.xml
Or you could add a new directory to SVN 'workplace' and add new pom.xml there and get all modules you could ever want via svn externals to one level (or to multiple levels).
In my case it is not possible to add another parent project. ModulA is already checked in SVN independently from the others.
This indicates that you're probably wrong in putting moduleA
in the <modules>
section. If moduleA
has different life cycle, then you should include it as a dependency.