限制 gradle 依赖项任务的显示深度
Limit displayed depth of gradle dependencies task
使用 gradle dependencies
我得到了一个包含所有依赖项的巨大列表。显示我依赖的项目的所有依赖项。是否可以限制显示列表的深度?
示例:
+--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
| +--- junit:junit:4.11 (*)
| \--- commons-io:commons-io:2.4
\--- org.slf4j:slf4j-log4j12:1.7.6
+--- org.slf4j:slf4j-api:1.7.6
\--- log4j:log4j:1.2.17
仅限于+--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
来自 gradle 网站:
dependencies - Displays all dependencies declared in root project 'projectReports'.
api:dependencies - Displays all dependencies declared in project ':api'.
webapp:dependencies - Displays all dependencies declared in project ':webapp'.
它甚至提到这些报告在 this official source 时会变大。
声明我应该使用--configuration
,但据我对这篇文章的理解,它只会限制它到compile
,testCompile
等等,而不是深入。
正在使用的版本 gradle 2.11
使用 grep:
仅显示顶级依赖项:
gradle dependencies --configuration compile | grep -v '| '
显示两个级别:
gradle dependencies --configuration compile | grep -v '| | '
等等
使用 gradle dependencies
我得到了一个包含所有依赖项的巨大列表。显示我依赖的项目的所有依赖项。是否可以限制显示列表的深度?
示例:
+--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
| +--- junit:junit:4.11 (*)
| \--- commons-io:commons-io:2.4
\--- org.slf4j:slf4j-log4j12:1.7.6
+--- org.slf4j:slf4j-api:1.7.6
\--- log4j:log4j:1.2.17
仅限于+--- com.company.common:e-common-junit:0.29.0-SNAPSHOT
来自 gradle 网站:
dependencies - Displays all dependencies declared in root project 'projectReports'.
api:dependencies - Displays all dependencies declared in project ':api'.
webapp:dependencies - Displays all dependencies declared in project ':webapp'.
它甚至提到这些报告在 this official source 时会变大。
声明我应该使用--configuration
,但据我对这篇文章的理解,它只会限制它到compile
,testCompile
等等,而不是深入。
正在使用的版本 gradle 2.11
使用 grep:
仅显示顶级依赖项:
gradle dependencies --configuration compile | grep -v '| '
显示两个级别:
gradle dependencies --configuration compile | grep -v '| | '
等等