0

I want to create my project structure as fallows-

my-main-project

| -- pom.xml | |-- project-B | |-- pom.xml | | | |-- project-B1 | |-- pom.xml

Kristy
  • 3
  • 3

1 Answers1

0

Just create your pom.xmls the usual way. On the inner ones you can add

  <parent>
    <groupId>(YOUR GROUP ID)</groupId>
    <artifactId>(YOUR ARTIFACT ID)</artifactId>
    <version>(YOUR VERSION)</version>
    <relativePath>../</relativePath>
  </parent>

To make them include the outer one.

Pedro Montoto García
  • 1,672
  • 2
  • 18
  • 38
  • But it gives error in parent's pom.xml Project build error: Invalid packaging for parent POM com.samples:mainproject:0.5.022 (/home/workspace/mainproject/pom.xml), must be "pom" but is "war" – Kristy Nov 21 '14 at 10:49
  • It depends on what you're building. If it's a webapp, specify the packaging on the child POM. Since it's a webapp I reccomend to use `bundle` on the child POM. http://stackoverflow.com/questions/5389691/what-is-the-meaning-of-type-bundle-in-a-maven-dependency – Pedro Montoto García Nov 21 '14 at 12:20