jamesfredley commented on code in PR #15467:
URL: https://github.com/apache/grails-core/pull/15467#discussion_r3344040116
##########
build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/ExtractDependenciesTask.groovy:
##########
@@ -257,93 +259,232 @@ abstract class ExtractDependenciesTask extends
DefaultTask {
}
Properties populatePlatformDependencies(CoordinateVersionHolder
bomCoordinates, List<CoordinateHolder> exclusionRules, Map<CoordinateHolder,
ExtractedDependencyConstraint> constraints, boolean error = true, int level =
0) {
- Dependency bomDependency =
dependencyHandler.create("${bomCoordinates.coordinates}@pom")
- Configuration dependencyConfiguration =
configurationContainer.detachedConfiguration(bomDependency)
+ def bomDependency =
dependencyHandler.create("${bomCoordinates.coordinates}@pom")
+ def dependencyConfiguration =
configurationContainer.detachedConfiguration(bomDependency).tap {
+ transitive = false
+ }
File bomPomFile = dependencyConfiguration.singleFile
- MavenXpp3Reader reader = new MavenXpp3Reader()
- Model model = reader.read(new FileReader(bomPomFile))
+ def doc = parsePom(bomPomFile)
Review Comment:
Done in 20f3304490.
`ExtractDependenciesTask` now parses BOM POMs with Maven's own
`org.apache.maven:maven-model` (`MavenXpp3Reader` -> `Model`) instead of the
hand-rolled `DocumentBuilderFactory` parsing, so
parent/properties/`dependencyManagement` and `<scope>import</scope>` resolution
mirror upstream Maven rather than a bespoke approximation.
On versioning: Spring Boot's BOM does not manage
`org.apache.maven:maven-model` (the `spring-boot-dependencies` POM only manages
`org.apache.maven.plugins:*`), so there is no Spring-Boot-managed version to
inherit. The version is pinned in `dependencies.gradle`'s
`gradleBomDependencyVersions` map alongside the other build-tooling versions,
on the Maven 3.9.x line (3.9.16), which still ships
`org.apache.maven.model.io.xpp3.MavenXpp3Reader`. It's deliberately kept out of
`gradleBomDependencies` so it is not published as a managed constraint in the
consumer-facing `grails-bom`.
Verified: `:grails-docs-core:compileGroovy` compiles, and
`:grails-bom:extractConstraints` / `:grails-base-bom:extractConstraints`
regenerate the constraint tables with property references (e.g.
`${logback.version}`) correctly resolved from the imported
`spring-boot-dependencies` BOM.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]