Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce war size for frequent redeployments(uploads) to a remote server

While development I need to frequently update my web app source code & deploy the updated war to a remote Tomcat server. Uploading a big war(25MB) takes too long(around 30 min) on my connection which is very unproductive. Is there any way I could reduce the war size ? There are a lot of external dependencies in my project. Could I deploy just the changes(may be dependencies remain intact) ?

like image 556
Rajat Gupta Avatar asked Feb 02 '26 08:02

Rajat Gupta


1 Answers

It depends how much control you have over the upload process. If you have remote access to the filesystem, the following should work:

  • Upload the WAR
  • Let Tomcat expand it
  • Stop Tomcat
  • Delete the WAR
  • Start Tomcat
  • Tomcat should run your app from the expanded directory
  • Upload changed files only and replace the old ones in the expanded directory
  • For static files, no further action is necessary
  • If up update classes or JARs, you'll need to restart Tomcat
like image 66
Mark Thomas Avatar answered Feb 04 '26 21:02

Mark Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!