【发布时间】:2014-08-23 16:55:46
【问题描述】:
当 IntelliJ 打开一个build.gradle 文件时,它将生成一个 IntelliJ 项目,其中已解决 Gradle 依赖项并将其添加到项目范围中。这对“编译”源集和“测试”源集非常有用,但是我无法让它适用于自定义源集。
我想让 IntelliJ 解决我的 componentTest 源集的依赖关系。如何告诉 IntelliJ 解决这些依赖关系并将它们添加到范围?
dependencies {
// main source set, "compile" scope in IntelliJ
compile(group: 'com.google.guava', name: 'guava', version: '18.0')
// test source set, "test" scope in IntelliJ
testCompile(group: 'junit', name: 'junit', version: '4.11')
// my custom source set, not added to any scope in IntelliJ
componentTestCompile(group: 'org.springframework', name: 'spring', version: '3.0.7')
}
详细信息: IntelliJ 13.1.2,Gradle 1.11
【问题讨论】:
标签: java intellij-idea gradle dependency-management