File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes building war file on remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "building war file on remote server" Watch "building war file on remote server" New topic

building war file on remote server

alex hendry

Joined: Jul 24, 2011
Posts: 4
Hi all,

I am currently working on a project that requires me to make frequent minor changes to my war file. My war file is about 50 mb and my home internet connection is not great so it is taking 10 or 15 minutes to upload to my webapps directory to redeploy.

I am looking for a quicker way to do this. I could put all my dependency jars in my tomcat lib to make the war file smaller as these take up about 45mb of the 50 mb but for various reasons I dont want to do this.

I had thought about installing subversion and a maven repository on my server and building my war file on the server rather than my local machine but I am not sure if this is the best way to go. I have had quite a bit of experience with maven and svn/cvs but I have always built my war file locally using maven or ant in eclipse then uploaded it. If I did install them on my server would I be best building the war from the command line? I am using a linux box (ubuntu) with tomcat 7. For this project I am using maven to create my war file.

Does anyone have any ideas?


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Welcome to the JavaRanch, Alex!

I've had the exact same problem, although with 20MB less on average. My primary datalink for years has been an IDSL line that could take up to half an hour to deploy. Finally I got enough paying customers to augment it with a 4G wireless ISP.

The one problem I ran into was that the hosting provider had gimmicked up the server I wanted to use as my build machine in a way that made Maven not run properly. I forget why, but there was something screwball about the OS setup.

Assuming you don't have that problem, however, and that the remote machine can call out to the Maven repositories to download things, there should be no issue with building deployable WARs and EARS via a remote command-line interface.

Where you put your source code repository is up to you. In my case, the slow data links were because I have hosting capabilities myself, but not the financial justification to run T1 speeds, so I can have a public SVN repository locally. You might find it better to host SVN on the remote server.

You don't actually need SVN hosting to do builds, however. Unless you want to. A local "mvn clean", then ZIP can produce a fairly small uploadable that can then be unzipped after upload to do the build.

An IDE is no substitute for an Intelligent Developer.
alex hendry

Joined: Jul 24, 2011
Posts: 4
Thanks for your reply Tim,

I have a unmanaged vps so I should not have any problems with installing what ever I need. At the moment I have svn and maven installed locally however I am not using svn for builds, just to track changes, tags for releases etc, but I have been building from my source code in eclipse. To start with I will do as you suggested and install maven on my server, upload zip then build. Once I get that going I will see if it is worth installing svn on my server and building from there.


I agree. Here's the link:
subject: building war file on remote server
It's not a secret anymore!