facebook

import exist maven project

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #329693 Reply

    yqian
    Member

    Hello,

    I have existing maven project and like to be included into multi module project, I added <module> into parent pom.xml, also added <parent> into existing project, but I got error ” cannot find child module when I run maven build

    Yi

    #329712 Reply

    support-piotr
    Participant

    Hello Yi,

    Is your parent pom in a parent directory of your module project? If not, you need to add <relativePath> element to your module project and refer to it in parent pom using relative path as well. E.g.; if your directory structure look like this:

    Workspace/
      parent-project/
        pom.xml
      child-project/
        pom.xml
    

    Assuming your parent-project pom.xml entries looks like:

      <groupId>com.example</groupId>
      <artifactId>example-parent</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <packaging>pom</packaging>
    

    you need to add:

      <modules>
        <module>../child-project</module>
      </modules>
    

    and in child-project pom.xml you need to specify parent pom with a relative path:

      <parent>
        <groupId>com.example</groupId>
        <artifactId>example-parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../parent-project</relativePath>
      </parent>
    

    I hope it helps! Let us know if you have any other problems.

    #329737 Reply

    yqian
    Member

    Thanks, Piotrek

    The module with relative path did the trick

    #329781 Reply

    support-swapna
    Moderator

    Yi,

    Glad that it worked.
    Do let us know if you see any issues.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: import exist maven project

You must be logged in to post in the forum log in