Search code examples
mavenmoduleparent-childpom.xmlmultiple-projects

How to create maven parent-project with war packaging option


i want to create three projects. One of them is parent project and the other two will be modules.

On this site http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html it is explained how to do. It says that the packaging type by parent should be pom. In my case it is not a good option. I want to use an existing project as parent project and create two additional modules.

Is it possible to define my existing project (war) as parent?


Solution

  • I suspect the only way to use a parent project is to define the parent packaging as pom. It clearly says so on the maven site, like you also pointed out. I really can't see what you want to achieve with your scenario because it seems to me that way its impossible for the two modules to exist as dependencies for the war...

    I strongly recommend you to create the parent pom add the other three modules under it (the two additional modules and the war/webapp module). Through separate parent you also have better control over the module build order, dependency management, global properties etc.