Approaches for Über / Fat JAR Deployment in Java EE
I believe the deployment and monitoring model for Java EE Application Server is outdated. If you want to learn more about my opinion refer to my article at JAXenter
, the slides
or my Interview at InfoQ
. Instead I advocate a model to deploy an application including all the needed infrastructure as a large JAR file. This model is supported e.g. by Vert.x
, the Play Framework
and of course Spring Boot
. However, what about Java EE applications? While in theory there is no reason why a Java EE should not be deployed as a huge JAR file - but there are not that many solutions to actually do that.
So here are some approaches that might be worth looking at:
- Spring Boot actually does support some Java EE APIs. A Blog Post describes this in more detail. It shows JAX-RS with Jersey, transactions with JTA and the Java EE annotation @Transactional, and also JSR 330 annotations for Dependency Injection. However, the example still uses some Spring classes and some technologies like EJB are not supported. But Spring Boot has a quite advanced model for metrics and monitoring, see Spring Boot Actuator.
- TomEE supports this model to some extend. See this older blog post. Also David Belvins of the TomEE team has quick demo and another demo.
- There is Backset that supports CDI, JSF and JPA - with EJB, JTA and JAX-RS on the roadmap.
- Finally this repro shows how to use Undertow with JAX-RS in a main method.
Thanks for the discussion over at Twitter
and all the help I got there. If you know any other options - please leave a comment. Thanks!
J for Java |
I for Internet, iMac, iPod and iPad |
Me for me