SOLR-17328: Add CycloneDX SBOMs to Solr binary distributions #3929
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change adds generation of CycloneDX SBOMs for both the full and slim Solr binary distributions. Two new tasks in the
:solr:packagingmodule produce SBOMs at build time using resolvable configurations that mirror the actual runtime dependencies included in each distribution.Each SBOM is written as
bom.jsonand packaged into the root of the corresponding distribution directory or.tar.gzarchive.Solution
Solr produces two distinct binary distributions, so the standard
cyclonedxBomtask from the CycloneDX Gradle plugin cannot be used directly. Instead of applying the plugin, this PR introduces:cyclonedxFullandcyclonedxSlimbomFullandbomSlimThe existing
packagingconfiguration cannot be reused because it contains only the assembled directory of dependencies, not the resolvable dependency graph itself. The new configurations therefore pull from the underlying project configurations that feed intopackaging, ensuring that the SBOMs accurately reflect the dependencies that end up in each distribution.Tests
Running any distribution-related task,
fullDistTar,installFullDist,slimDistTar, orinstallSlimDist, now produces abom.jsonfile in the output artifact for that distribution.Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.