Pregunta

I'd like to create a goal in maven to deploy my java webapp to production tomcat 7 instances. What's the best way to go about doing this? I'm hoping there's a plugin that handles SFTP'ing the war and telling tomcat to reload. This plugin would need to handle rollbacks in case of issues, uploading updated static files to S3 (resetting cloudfront caches for them) and possibly synchronizing db updates.

Does this demand a script run outside of Maven? Or is this auto-deploy functionality best accomplished with Ant?

¿Fue útil?

Solución

You can use the cargo-maven-plugin to achieve this. It will not SFTP it can directly remotely deploy to the Tomcat. If you need sftp you can use the wagon-plugin to scp the file and do a restart of Tomcat via cargo-plugin. Static files could be handled by the wagon-plugin (but i'm not sure at that point).

Furthermore you don't need to create goal (which would meant you will write a plugin).

I would suggest to create a separate maven-project which has the dependency to the war file you would like to deploy to production.

Otros consejos

For the DB updates part I would suggest using Liquibase (it also handles rollbacks). I don't know yet how you would do a deployment rollback but maybe If you're using the maven release plugin or any other way of release management you could manually deploy the previous release.

how about using elastic beanstalk and the maven beanstalk plugin?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top