Mike Mike - 5 years ago 1296
Java Question

Maven child module does not exist

I'm new to Maven. I checked out from SVN a project from a customer with the following structure:

projectName
|--> pom.xml
|--> jetty-wrapper
|--> pom.xml
|--> bin
|--> pom.xml
|--> projectName-common
|--> pom.xml
|--> bin
|--> pom.xml
|--> projectName-war
|--> bin
|--> pom.xml


the pom.xml right below 'projectName` (the pom at the top) is building the three modules

<modules>
<module>projectName-common</module>
<module>projectName-war</module>
<module>jetty-wrapper</module>
</modules>


But when executing
mvn clean install
from folder
projectName
it gives the following error

Child module [...]projectName\projectName-war\pom.xml of [...]projectName\pom.xml does not exist


The question is: Should there be a pom.xml right below
projectName-war
just like with the rest of the modules that my customer may have forgotten to commit to SVN?

Thanks!

Answer Source

The question is: Should there be a pom.xml right below projectName-war

Simply put yes.

You have already figured out the trick, and since you haven't provided a poject descriptor aka pom.xml to maven, it won't be able to call the projectName-war a valid child module.

There must absolutely be a pom.xml file under projectName-war, and it must have an artifact id that matches the one under the parent declaring the module, i.e.

<artifactId>rojectName-war</artifactId>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download