An Introduction to Hollow JARs
Blog post from Octopus Deploy
A Hollow JAR is a flexible and efficient deployment solution for Java applications that combines elements of both UberJARs and traditional application servers. Unlike an UberJAR, which contains both the application code and the code required to launch an application, a Hollow JAR only includes the latter, with the application code residing in a separate WAR file. This separation allows for frequent updates to the WAR file without altering the JAR, which can be advantageous in environments using layered container images or AWS autoscaling groups. The process of creating a Hollow JAR involves tools like SwarmTool, which facilitates the migration of existing applications to platforms like WildFly Swarm without significant modifications to the build process. This approach is demonstrated through the Ticket Monster demo application, where specific dependencies are adjusted to accommodate Java 9 and ensure compatibility with the Swarm platform. Hollow JARs offer deployment flexibility similar to UberJARs but with added efficiency in update management, making them a valuable option for automating Java application deployments.