Slackbot
06/02/2023, 6:00 PMAdam
06/02/2023, 6:13 PMJason Kolovsky
06/02/2023, 6:14 PMJason Kolovsky
06/02/2023, 6:15 PMconfigurations {
springBom
}
dependencies {
springBom "org.springframework.boot:spring-boot-dependencies:2.7.4"
}
def springBootComponent = configurations.springBom.incoming.resolutionResult.allDependencies.collect { it.selected.id }
def springBootBom = project.dependencies.createArtifactResolutionQuery()
.forComponents(springBootComponent)
.withArtifacts(MavenModule, MavenPomArtifact)
.execute()
for (component in springBootBom.resolvedComponents) {
component.getArtifacts(MavenPomArtifact).each {
def xml = new XmlSlurper().parse(it.file)
// do some crazy stuff here
}
}
Vampire
06/02/2023, 6:15 PMAdam
06/02/2023, 6:17 PMAdam
06/02/2023, 6:18 PMJason Kolovsky
06/02/2023, 6:21 PMAdam
06/02/2023, 6:35 PMpriorityApi
2. make the existing api
configuration extend priorityApi
3. add an additional ‘priority api’ attribute to all dependencies in priorityApi
(I’m not quite sure if this is possible)
4. now there’s a ‘marker’ that can be used to determine the origin of a dependency when selecting between candidates - if the candidate has the ‘priority’ attribute then it should be preferred
5. add child-bom as a platform dependency of priorityApi
Jason Kolovsky
06/02/2023, 6:36 PMAdam
06/02/2023, 6:48 PMconfigurations.create("priorityApi") {
withDependencies {
configureEach {
if (this is ModuleDependency) {
attributes {
attribute(project.objects.named("PriorityApi"), "priority")
}
}
}
}