feat: Add parent POM preservation with configurable dependency reorganization#624
Open
jan-van-de-pol wants to merge 1 commit into
Open
feat: Add parent POM preservation with configurable dependency reorganization#624jan-van-de-pol wants to merge 1 commit into
jan-van-de-pol wants to merge 1 commit into
Conversation
…ierarchy Signed-off-by: Jan van de Pol <jan.van.de.pol@telenetgroup.be>
132d8f0 to
5e81df6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR adds support for preserving parent POM references in the generated SBOM instead of flattening them into the effective POM model. This enhancement provides better visibility into the Maven project structure and dependency inheritance hierarchy.
Changes
New Configuration Parameters
preserveParentReferences(default:false): Enable parent POM preservationincludeParentsAsComponents(default:true): Control parent POM visibility in components sectiontrue, parent POMs appear as components in the BOMfalse, parent POMs are referenced only in the dependency graphImplementation Details
Modified Files:
BaseCycloneDxMojo.java: Added configuration parameters and component filtering logicModelConverter.java: Extended interface with parent detection and dependency extraction methodsDefaultModelConverter.java: Implemented parent POM detection and direct dependency extractionProjectDependenciesConverter.java: Extended interface for parent chain processingDefaultProjectDependenciesConverter.java: Implemented recursive parent chain walking and dependency reorganizationKey Features:
ProjectBuilderfor efficient parent POM resolutionTesting
ParentPreservationTest: Validates parent POMs appear as components with correct dependency graphParentNoComponentTest: Validates parent exclusion whenincludeParentsAsComponents=falseDocumentation
Use Cases
This feature is valuable for:
Backward Compatibility
This is a non-breaking change:
preserveParentReferences=false)Example
With
preserveParentReferences=true: