jdaugherty commented on code in PR #15467:
URL: https://github.com/apache/grails-core/pull/15467#discussion_r3343176816
##########
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:
I stopped reviewing after I saw this - we can't drop to custom xml parsing.
We should be using upstream libraries to do this (it doesn't have to be
Spring's). Maven actually publishes their maven-model library for this exact
purpose.
##########
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:
I stopped reviewing after I saw this - we can't use custom xml parsing. We
should be using upstream libraries to do this (it doesn't have to be Spring's).
Maven actually publishes their maven-model library for this exact purpose.
--
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]