I usually used to build the war file and then open the control panel of the hosting site and then upload my war file using either war upload or one one of their tools. Although it didn’t take much to do that, I always wanted to see if it can be done quicker than that by some sort of scripts.
So here is what I finally came up with. I am utilizing the FTP command.
I created a ftp.txt file with all the ftp command input including your user name and password. I will call this a config file. The config file looks something like this
Now you can run your ftp command as (alternately put this in a deploy.bat)
This should connect to your FTP and then upload your war file. If you would like to delete the existing WAR file ont he server, you can add the following line to your config just before your put command.
Deploy completed with just one line command !!