Is there a Gradle plugin equivalent of “mvn dependency:analyze”?

江枫思渺然 提交于 2021-02-08 16:59:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!