Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extend/customize a WAR with another project

We have the following scenario with our project:

  • A core web application packaged as a war file (call it Core project).
  • The need to "customize" or "extend" the core app per customer (call it Customer project). This mostly includes new bean definitions (we're using Spring), ie. replacing service implementations in the core.war with customer-specific implementations.
  • We want to develop the Core and Customer projects independently
  • When the Customer project is developed, we need to be able to run/debug it in Eclipse (on Tomcat) with the Core project as a dependency
  • When the Customer project is built, the resulting war file "includes" the core and customer projects. So this .war is the customer-specific version of the application

I'm looking for suggestions as to the best way to do this in terms of tooling and project configuration.

We're using Ant currently, but would like to avoid getting buried in more ant. Has anyone done this with Maven?

I've seen a lot of posts on how to build a web application that depends on a java application, but nothing on a web application depending on another web app.

Thanks!

like image 905
Marc Avatar asked Nov 03 '10 14:11

Marc


People also ask

How do I expand a WAR file?

Instructions provided describe a few methods for expanding a WAR file. Rename the .war file extension to .zip. Using any uncompression tool like WinZip, all contents can be extracted to a directory. Extract the contents of a WAR file using the JAR utility provided with any installation of JSDK.

How do I add a war task to a project?

If you want to configure all tasks of type War in the project then use tasks.withType (War.class).configureEach (… ). The default behavior of the War task is to copy the content of src/main/webapp to the root of the archive.

How to create a WAR file in Linux?

How To Create A War File In Linux? Make your war file using -C of jar. The command jar -c switch of jar creates. Then put the following command uc command line, uc, to create the war file. Go inside the project directory of your project (outside the WEB-INF), then write the following .

How do I create a WAR file in jar?

Make your war file using -C of jar. The command jar -c switch of jar creates. Then put the following command uc command line, uc, to create the war file. Go inside the project directory of your project (outside the WEB-INF), then write the following .


1 Answers

Sounds like Maven WAR overlay does what you want.

like image 178
maximdim Avatar answered Oct 21 '22 07:10

maximdim