Idiomatic way to create a BOM in a Maven multi-module
scordio opened this issue · comments
I would like to add a BOM for AssertJ.
My current attempt is at assertj/assertj#2748 where I include in the dependencyManagement
section what I'd like to have in the BOM and I configure the flatten-maven-plugin
with the bom
flatten mode.
However, if I don't specify resolve
as element handling for dependencyManagement
, ${project.version}
does not get expanded.
The additional configuration parameter is not a problem but I am wondering if there is a more idiomatic way to add a BOM for a Maven multi-module.
I have the same issue. I do not want the dependencies to be resolved and include all the transitive dependencies. It turns a 100 line POM into a 15,000 line pom.
I tried with a dummy variable and using interpolate but that Renovate has problems with that. Using FlattenDependencyMode with direct
did not work either.
Here is what we do
<configuration>
<flattenMode>bom</flattenMode>
<!-- Beside standard bom flatten mode, expand dependency version and remove the properties -->
<pomElements>
<build>remove</build>
<dependencyManagement>resolve</dependencyManagement>
<properties>flatten</properties>
</pomElements>
</configuration>