Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven child module does not exist

Tags:

java

maven

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 [...]projectName\projectName-war\pom.xml of [...]projectName\pom.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?

like image 265
Mike Avatar asked Sep 24 '14 15:09

Mike


1 Answers

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

If you are getting the above error when using mvn install from command line (the same pom may work in eclipse) you have to change your pom.xml little

Instead of the below:

<modules>
        <module>../my-util</module>
        <module>../my-server</module>           
</modules>

Follow the below (enclose in a profilers):

<profiles>
    <profile>
        <modules>
            <module>../my-util</module>
            <module>../my-server</module>           
        </modules>
    </profile>
</profiles>
like image 159
satish.kanikaram Avatar answered Sep 28 '22 18:09

satish.kanikaram