Gradle artifact 종속성 그래프 명령은 무엇입니까?
Gradle 문서 에서이 의견을 읽었습니다 .
To deal with problems due to version conflicts, reports with dependency graphs
are also very helpful. Such reports are another feature of dependency management.
항아리를 가져 왔지만 어디에서 왔는지 알아 내야합니다. 일반적으로 전역 적으로 제외하지만 여기에 계층 구조에 대한 정보가 필요합니다. Ivy와 Maven에서이 정보를 어떻게 얻을 수 있습니까?
누군가가 내 항아리 목록에 Hibernate 항아리 (많은)를 가져오고 있다는 사실은 말할 것도 없으며 Hibernate를 사용하지 않는 이후 누가 그 사람을 알고 그 의존성을 없애려고합니다.
명령은 gradle dependencies
이며 Gradle 1.2에서 출력이 훨씬 향상되었습니다. (오늘 1.2-rc-1을 시도해 볼 수 있습니다.)
아, 마스터 프로젝트에 종속성이 없으므로 "gradle dependencies"는 하위 프로젝트 종속성이 아닌 하위 프로젝트 종속성 만 나열하므로 올바른 명령이 끝났습니다.
gradle :<subproject>:dependencies
그래서 나에게 이것은
gradle :master:dependencies
프로젝트 및 모든 하위 프로젝트에 대한 종속성을 보려면 최상위 build.gradle에서 사용하십시오.
subprojects {
task listAllDependencies(type: DependencyReportTask) {}
}
그런 다음 gradle을 호출하십시오.
gradle listAllDependencies
구성이 많으면 출력이 꽤 길 수 있습니다. 런타임 구성에 대한 종속성 만 표시하려면 다음을 실행하십시오.
gradle dependencies --configuration runtime
하위 프로젝트를 재귀 적으로 포함하려면 언제든지 직접 작성할 수 있습니다.
최상위에 붙여 넣기 build.gradle
:
task allDeps << {
println "All Dependencies:"
allprojects.each { p ->
println()
println " $p.name ".center( 60, '*' )
println()
p.configurations.all.findAll { !it.allDependencies.empty }.each { c ->
println " ${c.name} ".center( 60, '-' )
c.allDependencies.each { dep ->
println "$dep.group:$dep.name:$dep.version"
}
println "-" * 60
}
}
}
로 실행 :
gradle allDeps
react-native
프로젝트 에서 gradle 종속성을 디버그하려는 경우 명령은 (에서 실행 projectname/android
)
./gradlew app:dependencies --configuration compile
gradlew -q :app:dependencies > dependencies.txt
모든 dependencies를 dependencies.txt 파일에 씁니다.
최신 버전의 Gradle (예 : 5 이상)에서 --scan
플래그로 빌드를 실행 하면 브라우저를 통해 클릭 할 수있는 모든 종류의 유용한 정보 (예 : 종속성 포함)를 알려줍니다.
gradlew --scan clean build
해당 빌드에서 진행중인 문제를 분석합니다. 꽤 깔끔합니다.
참고 URL : https://stackoverflow.com/questions/12288133/what-is-the-gradle-artifact-dependency-graph-command
'Programming' 카테고리의 다른 글
Java에서 단일 문자열 정렬 (0) | 2020.07.16 |
---|---|
DFS와 BFS O (V + E)의 시간이 복잡한 이유 (0) | 2020.07.16 |
종속성 'com.android.support:support-annotations'와 충돌합니다. (0) | 2020.07.16 |
공백이있는 jquery ID (0) | 2020.07.16 |
두 날짜 사이의 월 차이 계산 (0) | 2020.07.16 |