Files
git.stella-ops.org/docs/features/unchecked/scanner/java-maven-parent-pom-resolution-with-property-interpolation.md

29 lines
2.1 KiB
Markdown

# Java Maven Parent POM Resolution with Property Interpolation
## Module
Scanner
## Status
IMPLEMENTED
## Description
Resolves Maven parent POM inheritance chains and interpolates ${property} placeholders in version, groupId, and artifactId fields across the effective POM hierarchy.
## Implementation Details
- **Parent POM Resolution**:
- `src/Scanner/__Libraries/StellaOps.Scanner.Analyzers.Lang.Java/Internal/Maven/MavenParentResolver.cs` - `MavenParentResolver` resolves parent POM inheritance chains by following `<parent>` declarations
- `src/Scanner/__Libraries/StellaOps.Scanner.Analyzers.Lang.Java/Internal/Maven/MavenEffectivePomBuilder.cs` - `MavenEffectivePomBuilder` constructs the effective POM by merging parent and child POM properties, dependencies, and plugin configurations
- **Property Interpolation**:
- `src/Scanner/__Libraries/StellaOps.Scanner.Analyzers.Lang.Java/Internal/PropertyResolution/JavaPropertyResolver.cs` - `JavaPropertyResolver` resolves `${property}` placeholders in version, groupId, and artifactId fields across the POM hierarchy
- **POM Parsing**:
- `src/Scanner/__Libraries/StellaOps.Scanner.Analyzers.Lang.Java/Internal/Maven/MavenPomParser.cs` - `MavenPomParser` parses POM XML files extracting dependency declarations, properties, and parent references
- **Language Analyzer**: `src/Scanner/__Libraries/StellaOps.Scanner.Analyzers.Lang.Java/JavaLanguageAnalyzer.cs`
## E2E Test Plan
- [ ] Scan a Maven project with a parent POM hierarchy (child -> parent -> grandparent) and verify dependency versions inherited from parent are resolved
- [ ] Verify `${property}` placeholders in dependency versions are interpolated using properties from the effective POM hierarchy
- [ ] Verify `${project.version}` and `${project.groupId}` built-in properties are resolved correctly
- [ ] Verify `<dependencyManagement>` sections from parent POMs are applied to child dependency declarations without explicit versions
- [ ] Verify BOM imports (`<scope>import</scope>` in `<dependencyManagement>`) are resolved transitively
- [ ] Verify circular parent references are detected and handled gracefully