Class BomAlignmentExtension
The headline feature is inheritsFrom(String), which mirrors every artifact a parent BOM
manages as a direct api dependency on this project. It exists to break the propagation
deadlock you hit when a downstream BOM imports an upstream BOM as a platform(): the
platform() import contributes version constraints to resolution, so the downstream BOM's
alignment check is permanently clamped to whatever the upstream BOM's last release said.
Enumerating the managed artifacts directly removes that clamp while preserving the superset
invariant — every artifact the parent manages is still managed here.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinheritsFrom(String parentBomCoords) For every artifact managed byparentBomCoords, add anapidependency on this project at the same version selector asparentBomCoords(typically a dynamic version likelatest.releaseorlatest.integration).
-
Constructor Details
-
BomAlignmentExtension
public BomAlignmentExtension(org.gradle.api.Project project)
-
-
Method Details
-
inheritsFrom
For every artifact managed byparentBomCoords, add anapidependency on this project at the same version selector asparentBomCoords(typically a dynamic version likelatest.releaseorlatest.integration). BOMs imported by the parent BOM via<scope>import</scope>are followed transitively.Use this in place of
api(platform("..."))when you want the downstream BOM to be a superset of the upstream BOM but do not want the upstream's pins to constrain resolution during this project's alignment check.
-