I am developing a backend for an application using the Netty framework written in Java. Now I'm wondering what's the best way to deploy this application to my vServer. I see two general methods:
- Install just the Java runtime on the server; upload and run a locally built jar file of the application.
- Install the complete Java SDK with all dependencies on the server, checkout the source code from version control and build the application on the server.
Since I have no experience in deploying Java backends so far, I'd like to know what's the recommended/standard solution for this. I see pros and cons in both methods (method 1: easier setup, shorter downtimes between updates; method 2: less error-prone, tests can be run in production environment).
Thanks for your answers!