Spring Boot Dependency Management Highlights

Bill of Materials

Spring boot calls its collection of dependencies as BOM or bill of materials. When adding dependencies Spring boot tries to add matching dependency versions which will work together well.  The Spring Boot starter parent is responsible for most of the default configurations, plugins etc. which aides in the BOM. Your starter dependencies such as spring-boot-starter, spring-boot-starter-web and spring-boot-starter-jdbc etc. will not have to specify any version as all those is being handled by the starter parent.

Outside of software world, a bill of materials or product structure (sometimes bill of material, BOM or associated list) is a list of the raw materials, sub-assemblies, intermediate assemblies, sub-components, parts and the quantities of each needed to manufacture an end product. Read more @ https://en.wikipedia.org/wiki/Bill_of_materials.


Generating Spring Boot Uber Jar

If you are not using a Spring Boot starter parent and using Spring Boot only for dependency management by specifying ‘spring-boot-dependencies’ as a dependency, you will need to specify versions for your starter dependencies. This might be required if your project already has a parent pom and hence you cannot have a Spring boot parent, and as a work around you have added it as a dependency.

Plugins are not inherited anymore if you are specifying spring boot as a dependency rather than as starter parent; hence if you need to build the Spring boot application as a uber jar, as before, you will need to add dependency for spring-boot-maven-plugin. Now 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. Read more @ https://maven.apache.org/plugins/maven-shade-plugin/.

 An uber-jar is a jar that contains both your package 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. Read more @ http://imagej.net/Uber-JAR.

Search the Web

Custom Search

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