Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

merge two war files into one

 
neeravagl agl
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

i have two war files that i deploy separately.
now instead of going through that pain i want to make one war file, deploying which would deploy those two wars. this can make life easier for other developers where they can just deploy one war instead of multiple.
I am using maven.

can anybody give ideas to approach this.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Don't.

By definition, a WAR is an atomic unit of deployment. The only way to make a deployable with multiple WARs in it would be to create an EAR file. That works for the full-service J2EE servers, but not for Tomcat. Tomcat can't handle EARs.

In any event, an EAR is a single webapp deployment itself, so it's not going to work very well for deploying multiple unrelated webapps.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Maven places the contents of the WAR into target/project-name, why not create and ant script that builds a WAR from the two target/project-name directories? You could even embedded the ant script within a pom is you must use mvn.
 
Andres Gomez Casanova
Greenhorn
Posts: 1
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to use assembly plugin.

Maven Assembly Plugin

neeravagl agl wrote:Hi everyone,

i have two war files that i deploy separately.
now instead of going through that pain i want to make one war file, deploying which would deploy those two wars. this can make life easier for other developers where they can just deploy one war instead of multiple.
I am using maven.

can anybody give ideas to approach this.
 
zabin shariff
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have the same issue, but I am not using Maven. I want to merge two war files by using ANT. Can anybody tell me how can I do that?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zabin, since your question is not the same as the original poster's please ask it in a new post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic