Skip to content
Advertisement

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 projectNameit gives the following error

Child module [...]projectNameprojectName-warpom.xml of [...]projectNamepom.xml does not exist

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

Advertisement

Answer

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 project 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>projectName-war</artifactId>
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement