【问题标题】:Gradle equivalent to maven dependency:listGradle 相当于 maven 依赖:list
【发布时间】:2017-03-30 22:27:43
【问题描述】:

Maven 提供了一种使用mvn dependency:list 显示所有已解析依赖项列表的方法:

[INFO] The following files have been resolved:
[INFO]    org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO]    org.hibernate:hibernate-core:jar:5.2.3.Final:compile
[INFO]    javax.inject:javax.inject:jar:1:compile
[INFO]    javax.annotation:jsr250-api:jar:1.0:compile
[INFO]    org.javassist:javassist:jar:3.20.0-GA:compile
[INFO]    org.jboss:jandex:jar:2.0.0.Final:compile
[INFO]    com.fasterxml:classmate:jar:1.3.0:compile
[INFO]    org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:com:compile
[INFO]    javax.el:el-api:jar:2.2:compile
[INFO]    org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile

Gradle的依赖报告是树形结构,很难看清最终使用的版本。

是否有一个命令或什么东西可以给我这个没有树结构的已解决依赖项列表?

【问题讨论】:

标签: gradle dependency-management gradle-dependencies


【解决方案1】:

如果您在命令行(在您的 gradle 项目目录中)执行以下操作

gradle tasks

您将在列表中看到以下内容

Help tasks
----------
dependencies - Displays all dependencies declared in root project 'xyz'.
dependencyInsight - Displays the insight into a specific dependency in root project 'xyz'

更多信息here

【讨论】:

  • 然而,这些都不能完全满足要求。 “依赖项”任务更等同于mvn dependency:tree,它以树状结构给出结果(提问者明确指出他们不想要的东西)。
猜你喜欢
  • 1970-01-01
  • 2013-07-17
  • 1970-01-01
  • 2016-08-01
  • 1970-01-01
  • 2016-09-07
  • 2014-01-26
  • 2017-06-22
  • 1970-01-01
相关资源
最近更新 更多