Deploying Java Server Applications That Are Not .wars

Are there well-integrated application stacks that allow you to create, deploy, and update non-t20> Java applications that work as servers? For example, consumers of messages that are servers (but not web servers and do not have servlets), or executable .jar with Jetty embedded?

Building and deploying .war pretty straightforward: Maven has an archetype of war, Jenkins has tons of plugins for deploying .war files to various application servers, most of which accept the loading of new web applications at runtime. Tools such as Elastic Beanstalk simplify this process by linking management of the server environment.

Unlike deploying the .jar executable, it seems like reinventing the wheel. You need to figure out the best way to obscure dependencies and create an executable artifact with many Maven plugins, place this artifact somewhere, then find a way to install it on the target servers and replace / update it if necessary (Debian packages would be one way to do this).

All this seems very β€œmanual” to me, so it seems appropriate to deploy applications like .war on application servers, even if they are not suitable for such an environment, so that you get the benefits of tool support.

+7
source share
2 answers

This can be achieved by deploying applications to the osgi container.

You can connect to the osgi life cycle to launch the application when the osgi bundle is running. Then you can remotely start and stop the container (if the container supports this).

Your applications can define their dependencies as part of the osgi manifest, but shading banners using the shadow plugin is not difficult when using maven, and I think it would be easier to manage and not deal with hundreds of jars in your container.

This question speaks of the continuous deployment of osgi bundles using Jenkins.

An alternative (and more standard) way would be to write scripts that automate deployment β€” perhaps using specially crafted tools like puppet or chef . There is a maven puppet plugin that allows you to extract artifacts from the maven repository for use in your puppet scripts.

Running a Jenkins puppet or chef is trivial, and if you want, you can provide access to deployment assemblies to non-technical employees to allow them to deploy new assemblies to the environment with the click of a button.

Like @bagheera offers to create rpms of your applications and run them, because services are a good way to go and reduce the complexity of your deployment scripts.

+4
source

It looks like you're looking for a dependency manager to create a stand-alone executable jar and a package manager for deployment. In addition to the tools you mentioned, you can check ant + ivy for build + mgmt and rpmbuild + rpm + yum dependencies for package management on Linux.

+3
source

All Articles