views:

205

answers:

1

I want to assemble a web module which looks like the following:

  • src/main/java (has some common utilities, actions etc.)
  • src/main/resources (has some spring beans files, configuratios etc.)
  • src/main/webapp (has some jsp, css, images etc.)

and then I want to use this assembled module as a dependency in another web application which also looks like a typical maven 2 web application.

  • src/main/java (has some actions etc.)
  • src/main/resources (has some spring beans files, configuratios etc.)
  • src/main/webapp (has some jsp, css, images etc. and web.xml)

Basically I want that on building (mvn clean install)the main web application, the common web module is assembled first and then is merged with the main web application and then the final set up (after assembly and merging) should be built and .war should come out of it.

I tried using maven assembly and dependency plugin but could not successfully merge the modules though I was able to assemble the module. Anyone has an idea on how to do this?

+2  A: 

Try to use maven-war-plugin overlays feature.

cetnar