0

I would like to create a multi module project where more than one module is of type war. for example

<module>somejars</module>
<module>servletsAndJsps</module>
<module>springMVCapp</module>
<module>angularJsApp</module>

3 of those would work independly as WAR apps, but when I run mvn install command on parent it would create a super app that contains all 3 apps. web.xml's would be somehow merged or parent web.xml would be used.

please help

IAdapter
  • 62,595
  • 73
  • 179
  • 242
  • You should look at the different packaging types java offers, see http://stackoverflow.com/questions/1594667/war-vs-ear-file. I guess you are looking for an ear-packaging which allows to pack multiple wars and jars for deployment for an application server. – jethroo Jan 20 '14 at 19:49
  • no, i'm not looking for ear – IAdapter Jan 20 '14 at 22:02
  • Can you show use your pom files, cause it sounds a little bit weird. – khmarbaise Jan 21 '14 at 07:30

1 Answers1

2

When you run maven install on your multimodule project the maven reactor plugin will by default run install on parent project and then on the 3 or 4 sub module projects. Since you want to club all three wars together I would suggest create one more sub module named clubbedWars

<module>somejars</module>
<module>servletsAndJsps</module>
<module>springMVCapp</module>
<module>angularJsApp</module>
<module> clubbedWars </module>

Now add all the other modules as dependeny in this module clubbedWars. This module’s install will get run last after all other modules install has run. Now simply use copy-dependency and assembly plugin of maven in this module to club all these three wars together and install them in clubbedWars war or zip.

Ashay Batwal
  • 5,415
  • 7
  • 25
  • 30