Maven Build not found child module

I've Maven project with one subproject, when I run my install task on parent project from IDEA (IntelliJ IDEA) all works fine and maven resolve child module.
My projects are versioned on subversion, and this is the filesystem structure:

project
|--pom.xml
|--subproject
   |
   |-- branches
   |-- tags
   |-- trunk (here there is my subproject source, also pom.xml file)

I've create project with its subproject, from svn URL, on teamcity server.

When I run Build on parent project it fail and return me the following error:

[Step 1/1] Error reading Maven project: Some problems were encountered while processing the POMs:
[ERROR] Child module /opt/buildAgent/work/ee114e0c77ee2c44/subproject of /opt/buildAgent/work/ee114e0c77ee2c44/pom.xml does not exist @ 


How can I say to parent-project-build where it find the child module?

Is there something else wrong?

Parent POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>it.company.project</groupId>
  <artifactId>MyProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>MyProject</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <modules>
    <module>Foo</module>
  </modules>
</project>


Child POM:

<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>it.company.project</groupId>
        <artifactId>MyProject</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <groupId>it.company.subproject</groupId>
    <artifactId>subproject</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>subproject</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
        </resources>
    </build>
</project>

Thanks

4 comments
Comment actions Permalink

Hi Matteo,

Could you please try to run this project via console using, not using TeamCity?

0
Comment actions Permalink

Also when I run build via command line I've the same error by maven.
The problem is that in my developer machine the subprojects are directly under the parent project (parent_project->subproject), while on my SVN server the subprojects are on trunk folder (parent_project->subproject->trunk).

0
Comment actions Permalink

It does not look like TeamCity related issue. Interested users can see the same question asked in stackoverflow.

0
Comment actions Permalink

Hello 

please use the correct module name in parent pom.xml file 

  <modules>
    <module>subproject</module>
  </modules>
0

Please sign in to leave a comment.