Gradle BOMs - root project or subproject?

Is there consensus on whether the BOM I am publishing (to maven repo) for my project should be

  • a subproject ie ‘egeria-bom’ (our project is called egeria, as is the name of the root project)
  • the top level project (no dependencies etc)

Our top level project, even in maven days, was little more than a packaging pom & kinda-accidentally ended up being the BOM

I’ve seen both examples, and there is little difference technically - both using the java-platform project, and of course with gradle it’s very flexible… this is more about convention

When we built with maven it was one and the same as the parent. With gradle there were some issues with the BOM (inappropriate content in the bom) which I’ve fixed.

Searching maven central seems to suggest that having a distinct dependency ie ‘org.odpi.egeria:egeria-bom’ is the pattern many projects follow - so what I am inclined to do

I did also note that we are using the aggregate javadoc extension. This requires the ‘java’ plugin, but of course the ‘java-platform’ plugin is mutually incompatible. So one or the other has to move out – platform is easier, though impacts any consumers (limited use)

This is what I have settled on as my go-to pattern for these scenarios.

1 Like