The approach of having a single JAR with all its needed dependencies may sound nice to begin with, but this approach may not work for everyone. Fat JARs are easy to deploy and run, but they do bring some complexities along with them:
- Deployment size of the application JAR increases, as you would be bundling some parts of an application server within the deployment file
- Deployment time increases, considering the file size and the need to upload it to different environments
The traditional Skinny WAR, when built against Java EE standards, can be measured in a few kilobytes (KB). Moving this around over the network is much simpler than doing the same with a Fat JAR, which bundles shared libraries along with the application code.
A more familiar style of working with web applications is to create a WAR file. This is your unit of deployment, which gets placed in a Java...