MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
yqian
Post subject: import exist maven project  PostPosted: Aug 30, 2012 - 05:58 PM



Joined: Apr 25, 2012
Posts: 7

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
 
 View user's profile Send private message  
Reply with quote Back to top
support-piotr
Post subject:   PostPosted: Aug 31, 2012 - 08:43 AM



Joined: Feb 10, 2011
Posts: 67

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:
Code:
Workspace/
  parent-project/
    pom.xml
  child-project/
    pom.xml

Assuming your parent-project pom.xml entries looks like:
Code:
  <groupId>com.example</groupId>
  <artifactId>example-parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>

you need to add:
Code:
  <modules>
    <module>../child-project</module>
  </modules>

and in child-project pom.xml you need to specify parent pom with a relative path:
Code:
  <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.

_________________
Piotrek
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
yqian
Post subject:   PostPosted: Aug 31, 2012 - 04:23 PM



Joined: Apr 25, 2012
Posts: 7

Thanks, Piotrek

The module with relative path did the trick
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Sep 03, 2012 - 05:36 AM



Joined: Nov 11, 2010
Posts: 2193

Yi,

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

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits