Class RenderSpdxLicensesMojo

java.lang.Object
network.ike.plugin.RenderSpdxLicensesMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="render-spdx-licenses", defaultPhase="pre-site") public class RenderSpdxLicensesMojo extends Object implements org.apache.maven.api.plugin.Mojo
Render an SPDX-grouped licenses.adoc from the CycloneDX SBOM (ike-issues#335).

Reads target/bom.json (produced by cyclonedx-maven-plugin at package phase per ike-issues#333), groups every component by its SPDX license identifier or expression, and writes target/generated-site/asciidoc/licenses.adoc. The Maven Site Plugin then renders that AsciiDoc to target/site/licenses.html with the same Forest-theme chrome as every other site page — no manual HTML / skin-chrome duplication.

Components with multiple licenses array entries (the JRuby case: GPL-2.0 + LGPL-2.1 + EPL-2.0) are collapsed into a single SPDX OR-expression with deterministic alphabetical ordering, so the same combination always groups under the same heading. Components carrying a CycloneDX license.expression field use that verbatim.

The auto-generated licenses.html from maven-project-info-reports-plugin should be disabled in the reactor's <reportSets> configuration so the only licenses.html produced is the SPDX-grouped one. Without that disable step both reports race for the same target file and the winner depends on plugin ordering.

Skip with -Dike.skip.spdx-licenses=true to fall back to whatever the auto-generated licenses report would produce (assuming it's still enabled in <reportSets>).

mvn package                              # produces bom.json
mvn ike:render-spdx-licenses             # produces licenses.adoc
mvn site                                 # renders licenses.html
See Also:
  • Constructor Details

    • RenderSpdxLicensesMojo

      public RenderSpdxLicensesMojo()
      Creates this goal instance.
  • Method Details

    • getLog

      protected org.apache.maven.api.plugin.Log getLog()
      Access the Maven logger.
      Returns:
      the logger
    • execute

      public void execute() throws org.apache.maven.api.plugin.MojoException
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException