Java idea中的gradle项目依赖
我在一个子项目(A)中配置了测试工件:Java idea中的gradle项目依赖,java,android,intellij-idea,gradle,Java,Android,Intellij Idea,Gradle,我在一个子项目(A)中配置了测试工件: configurations { testArtifacts.extendsFrom testRuntime } task testJar(type: Jar) { classifier "test" from sourceSets.test.output } artifacts { testArtifacts testJar } compile project (path: ":a-sub-project", confi
configurations {
testArtifacts.extendsFrom testRuntime
}
task testJar(type: Jar) {
classifier "test"
from sourceSets.test.output
}
artifacts {
testArtifacts testJar
}
compile project (path: ":a-sub-project", configuration: 'testArtifacts')
在另一个子项目(B)中,我想使用该工件:
configurations {
testArtifacts.extendsFrom testRuntime
}
task testJar(type: Jar) {
classifier "test"
from sourceSets.test.output
}
artifacts {
testArtifacts testJar
}
compile project (path: ":a-sub-project", configuration: 'testArtifacts')
这在gradle中运行得非常好,但当我将项目导入idea时(通过内置支持),idea无法看到该工件中的类。它可以从(A)的主要工件中看到类,但不能从测试一中看到
有什么想法吗
PS.Idea 14.1.4,gradle 2.3.对我们来说,这很好:
testCompile project(':module').sourceSets.test.output
因此,实际上您不需要测试jar任务