Class BomAlignmentExtension

java.lang.Object
org.openrewrite.gradle.BomAlignmentExtension

public class BomAlignmentExtension extends Object
DSL extension for the BOM alignment plugin.

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
    Constructor
    Description
    BomAlignmentExtension(org.gradle.api.Project project)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    inheritsFrom(String parentBomCoords)
    For every artifact managed by parentBomCoords, add an api dependency on this project at the same version selector as parentBomCoords (typically a dynamic version like latest.release or latest.integration).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BomAlignmentExtension

      public BomAlignmentExtension(org.gradle.api.Project project)
  • Method Details

    • inheritsFrom

      public void inheritsFrom(String parentBomCoords)
      For every artifact managed by parentBomCoords, add an api dependency on this project at the same version selector as parentBomCoords (typically a dynamic version like latest.release or latest.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.