Spring Boot Dependency Management - BOM and Uber Jar

Bill of Materials

Spring boot calls its collection of dependencies as BOM or bill of materials.

The Spring Boot starter parent is responsible for most of the default configurations, plugins etc. which aides in the BOM. When adding dependencies, Spring boot tries to add matching dependency versions which will work together well.  Your starter dependencies such as spring-boot-starter-web will not have to specify any versions.

Outside of software world, a bill of materials (BOM) is a list of the raw materials, sub-assemblies, sub-components, parts and the quantities of each, needed to manufacture an end product.

 

Generating Spring Boot Uber Jar

 An uber-jar is a jar that contains both your package code and all its dependencies so that you can distribute your uber-jar and not care at all whether or not dependencies are installed at the destination. An uber-JAR is also known as a fat JAR or JAR with dependencies. 

If your project already has a parent pom, you cannot have a Spring boot parent, and as a work around you have added it as a dependency. However, unlike with the boot parent, plugins are not inherited when using Spring Boot as a dependency.

You can run mvn package to generate the Spring boot uber jar as with using a starter parent.

There are also maven plugins that can help you create uber jars such as maven-shade-plugin, but is not Spring boot aware. 

 

JavaJee Checks: 
https://maven.apache.org/plugins/maven-shade-plugin/.

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!