
286
자바 마이크로서비스를 활용한
SRE
val observedDependencies = TreeSet<ResolvedDependency> { d1, d2 ->
gav(d1).compareTo(gav(d2))
}
fun reduceDependenciesAtIndent(indent: Int):
(List<String>, ResolvedDependency) -> List<String> =
{ dependenciesAsList: List<String>, dep: ResolvedDependency ->
dependenciesAsList + listOf(" ".repeat(indent) +
dep.module.id.toString()) + (
if (observedDependencies.add(dep)) {
dep.children
.sortedBy(gav)
.fold(emptyList(), reduceDependenciesAtIndent(indent + 2))
} else {
// 하위 트리에 이미 출력했던 의존성은 건너뛴다.
emptyList()
}
)
}
project.plugins.withType<InfoBrokerPlugin> {
add("Resolved-Dependencies", runtimeClasspath
.resolvedConfiguration ...