salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
224 stars 48 forks source link

Support for the Spring Boot thin jar layout #125

Open plaird opened 3 years ago

plaird commented 3 years ago

Spring Boot has an experimental thin layout.A thin Spring Boot jar does not contain the dependencies internally like in the fat jar. The thin loader reads a descriptor (pom.xml or thin.properties) that then triggers the loader to download those dependencies at first launch of the service.

Spring Boot Thin Jar

I am not wild about it because it runs contrary to the idea of the Bazel principle of producing a hermetic output. I see the value though - if you distribute your app widely, it reduces the size of the binary that you push to your users. If those users already have your deps in their .m2/repository, they won't have to incur the cost of downloading the fat jar with all of them.