是否有一个与"MVN依赖项:分析"等效的Gradle插件? [英] Is there a Gradle plugin equivalent of “mvn dependency:analyze”?
问题描述
我想分析我的项目依赖关系.是否有一个Gradle插件等效于
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
推荐答案
有一个 gradle-您可以尝试使用的依赖性分析插件.它会分析您的项目依赖关系,并且如果声明了依赖关系但未使用或未使用依赖关系,则构建失败.
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.
您可以声明如下:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'ca.cutterslade.gradle:gradle-dependency-analyze:1.2.0'
}
}
apply plugin: 'java'
apply plugin: 'ca.cutterslade.analyze'
并通过以下任务之一运行它: analyzeClassesDependencies
, analyzeTestClassesDependencies
或 analyzeDependencies
.
And run it via one of the tasks: analyzeClassesDependencies
, analyzeTestClassesDependencies
or analyzeDependencies
.
这篇关于是否有一个与"MVN依赖项:分析"等效的Gradle插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!