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:
- 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 thedependencyManamgenent
section of the pom.xml file. - 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 usecom.fasterxml.jackson.dataformat.smile
which is not defined in the BOM. So we added the specific dependency to the app's pom.xml (dependencied
anddependencyManagement
). Is it possible to re-use thejackson
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.
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.