Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java idea中的gradle项目依赖_Java_Android_Intellij Idea_Gradle - Fatal编程技术网

Java idea中的gradle项目依赖

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

我在一个子项目(A)中配置了测试工件:

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任务