You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrius Karpavicius <An...@sintagma.lt> on 2005/08/12 17:15:22 UTC

[m2] How to include web content from multiple modules into a single WAR

HI,

My web application is made up of several modules. Each module contains 
classes and web content (jsp and WEB-INF/conf configuration files)

Question - how do I get web content from several projects assembled into 
one war file

Here is the structure

+- pom.xml
+- app_1
   +- pom.xml
   +- src
      +- main
         +-java
         +-resources
         +-webapp
+- app_2
   +- pom.xml
   +- src
      +- main
         +-java
         +-resources
         +-webapp
+- WAR_app_3
   +- pom.xml
   +- src
      +- main
         +-java
         +-resources
         +-webapp

WAR_application_3 is a main application and can function with or without 
app_1 and/or app_2 (think of them as extra features)
web.xml is contained only in WAR_application_3. 
A dependancy is set in WAR_app_3 with app_1, app_2 applications.

Using a standard Multiple modules description in 
http://maven.apache.org/maven2/getting-started.html a single WAR file is 
generated with app_1.jar and app_2.jar files included in WAR_app_3.war. 

Currently I have app_1 and app_2 packaging set as jar, WAR_app_3 set as 
war.

What do I need to do, so app_1/src/main/webapp and app_2/src/main/webapp 
files be included in WAR_app_3.war file as well.

Somehow, before generating war, i would have to copy all webapp files from 
other projects into the main one (WAR_app_3). 

On the other hand, webapp files should go to the repository of original 
projects (app_1, app_2) - that is I would have to build them all as war 
files, and during dependancy management extract web content.

Thank you for help,
Andrius

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org