问题
I want to analyze my project dependencies.Is there a Gradle plugin equivalent to
mvn dependency:analyze
which will analyzes the dependencies of this project and produces a report that summarizes which are: used and declared; used and undeclared; unused and declared
回答1:
There is a gradle-dependency-analyze plugin you can try to use. It analyses your project dependencies and fails a build if dependencies are declared but not used or used but not declared.
You can declare it as follows:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'ca.cutterslade.gradle:gradle-dependency-analyze:1.2.0'
}
}
apply plugin: 'java'
apply plugin: 'ca.cutterslade.analyze'
And run it via one of the tasks: analyzeClassesDependencies
, analyzeTestClassesDependencies
or analyzeDependencies
.
来源:https://stackoverflow.com/questions/48377905/is-there-a-gradle-plugin-equivalent-of-mvn-dependencyanalyze