This question is somewhat similar to this Best way to deploy a large * .war on tomcat so that it reads well at first, but keep reading my qs, these are different at the end ...
Using maven 2, my war files are terribly large (60M). I put them on a set of tomcat servers, and just copying the files takes too much time (this is about 1 m to the war).
In addition, I added an RPM level that packs war in an RPM file (using the maven rpm plugin). When the RPM is launched on the target machine, it will clear, βinstallβ the war (just copy it), stop and start tomcat (what we do here, without hot deployments) and configure the proper context file in place. All of this works great.
The problem, however, is that the RPM files are too large and slow to copy. That occupies almost all of the space, of course, is a military file.
I have not seen any ready-made solution, so I'm going to implement it myself, so I will describe it below, and this description, we hope, will help explain the problem area. I will be glad to hear your thoughts on the planned solution, and even better to point out other existing solutions and random advice.
War files contain:
- Applied banks
- Third Party Banks
- resources (properties files and other resources)
- WEB-INF files such as JSP, web.xml, struts.xml, etc.
Most of the space is occupied by # 2, third-party banks.
Third-party banks are also installed on the internal server for communication that we have in the company, so I can take advantage of this.
You probably guessed that at the moment the plan is to create subtle wars that will include only application banks (created by my company), WEB-INF resources and materials, and adding the ability to install an RPM script that will copy third-party banks if necessary.
RPM allows you to run arbitrary scripts before or after installation, so the plan should use mvn to write a list of third-party dependencies when creating a war and adding it as a resource in RPM, and then when installing the RPM installation, the RPM script will work on the list of necessary third-party banks and load new banks from nexus only if they do not already exist.
RPM will have to remove banks if not in use.
RPM will also have to either rebuild the war for tomcat to detonate it, or add third-party banks to common / lib or something like that, although we have several web applications for one cat, so in this sense this will complicate the situation. Perhaps explode the jar yourself, and then copy the third-party jars to WEB-INF / lib
Your input is welcome :)