0
votes

I have several modules that I build in a maven multi module project. I can call maven on the head pom.xml in the parent directory and build all modules. However, Jenkins only builds the first module of several svn repos I have configured by calling mvn -f <first child module it sees>, and never builds the other child modules. I tried creating a new Jenkins project, but the same problem occurs.

1
Sounds like you have misconfigured jenkins, cause usually you simply configure the file name pom.xml and no path for it. - khmarbaise
I don't believe that this is a mistake on my part. I have tried deleting the child module directories, so that the parent folder only contains the pom.xml. Only then, does Jenkins try to do a build on this pom.xml (and fails because it can't find the relevant modules). The moment I add in the modules, it does a build on the first module that it finds only. This is with incremental build/parallel build disabled. - imagineerThat
Please show your pom files and show the structure of your project. May be you have this on a github project so it's simpler to look into? Which Maven Version do you use on command line and in Jenkins? Which Jenkins verison do you use? - khmarbaise
It took much of the weekend, but I finally figured it out. Would have shown you the poms earlier, but they have lots of identifying information and my employer is tight on privacy. The problem was solved by having the parent module directory listed as a repo in the job. Before, the module was simply a pom.xml I would download. If I didn't list the parent module as one of the repos, Jenkins would think the first child module under my repos was the parent pom. Listing an absolute path to the parent pom helped for a clean build, but not for a mvn incremental build. Doing what I did worked. - imagineerThat
An addition clarification: before the first child pom listed in the repos would build, which really meant that for an incremental build, it would do -amd -pl <child repo Z>. This was incorrect, because I would do an update on <child repo Y> and it would still update Z after an svn poll. Should I submit a Jira report to Jenkins? - imagineerThat

1 Answers

0
votes

In the Advanced section of the maven configuration block, are you definitely pointing at the parent pom? Jenkins only executes maven once, against the pom specified in this section.