Ümit
Ümit

Reputation: 17489

Spring IO Platform Bill-Of-Materials custom version

In order to simplify dependencies and the pom.xml file, I updated a Spring MVC app to use Spring IO platform Bill-Of-Materials.

However I have two problems:

  1. Overriding a specific version of a depdencency defined in the BOM: Spring IO platform sets the jetty version to 8.x however we are relying on jetty 9.x. According to the docs, overriding a specific dependency should be as simple as adding a property with the same name to the pom.xml file (i.e. <jetty.version>9.x</jetty.version>). However this does not work. I have to explicitly add the dependency with the correct version to the dependencyManamgenent section of the pom.xml file.
  2. Using properties from the BOM inside of the app's pom.xml: AFAIK Spring IO platform BOM specifies the dependency versions using properties (i.e. com.fasterxml.jackson). However we want to use com.fasterxml.jackson.dataformat.smile which is not defined in the BOM. So we added the specific dependency to the app's pom.xml (dependencied and dependencyManagement). Is it possible to re-use the jackson version property in the pom.xml ? Currently we have to add property (i.e. <com.fasterxml.jackson.dataformat.smile>) with the corresponding version and when we update the spring io platform version we have to make sure to also update this property.

Upvotes: 1

Views: 548

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116091

You've hit a limitation in Maven. Reusing properties from a bom only works if your pom inherits the bom, either directly or indirectly, via its parent.

Perhaps you could use the Platform bom as the parent of the pom where you're currently defining the common dependencies.

Upvotes: 2

Related Questions