4

I have a project that uses Spring. Every time I deploy, I run the maven goal "package", which runs all the tests and creates the war file. Then I manually use an ftp program to copy the war file to the server. I then run a bash script to shut down the server, replace the war and start up the server again.

Sometimes when they are changes done to the database schema, I have to run a sql migration script manually.

Is there a better workflow I can use? As the project's war file gets to be 60MB, I am having to wait 10-12 minutes to upload it to the server. If I realize that one little thing needs to be changed, I have to do the whole process all over again.

It's doubly bad for me because on DSL, upload bandwidth kills download bandwidth, so the internet is completely inoperable. Even working on the project and running maven goals is slow because they use the internet connection to look for dependencies all the time.

Is there a better way to work? Thanks.

1 Answer 1

1

First of all you could avoid manual ftp copies by using the Maven Deploy plugin. You can find an how-to to deploy projects over ftp at this URL:

http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

Second point is a question about your project: is your WAR size normal?
I've heard of configurations that embedded superfluous jar in order to avoid the problem of META-INF/spring.handlers overwriting when building the final jar. If you're in this situation, you might be interested by this too:

http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

Sign up to request clarification or add additional context in comments.

2 Comments

Well, I don't mind uploading it to the server. I don't think this manual step is really the problem. What I want to do is not have to upload 60 MB at all if I can, especially if I only make 2KB worth of changes. Is there any way to synchronize the source and server and do a build on the server itself through maven?
Well I don't think you can do a build on the server if you don't have an ssh access to it. I don't know Spring at all but it seems possible to update webapp parts if you're using Tomcat (tomcatexpert.com/knowledge-base/deploying-exploded-war-files). If it's so, you could then deploy these separated files with maven deploy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.