2016-08-29 14 views
0

カスタムタスク "integTest"を実行しているときにこのエラーが発生し、Gradle 2.4と3.0の両方で試行されました。まだまだかなり新しくなって、明らかなものになるかもしれません。Gradle Error:Groovyクラスパスを推測できません:統合テストのカスタムソースセット

FAILURE:例外が発生してビルドに失敗しました。

何が間違っていた:何のGroovyのJARが クラスパス上で見つからなかったため

は、Groovyのクラスパスを推測することはできません:ファイルコレクション

統合テストのすべてが、それはちょうど私ことだ、個別に細かい実行しますこのタスクは適切なクラスパスを取得していないように見えるので、それらをすべて実行することはできません。

洞察力があれば幸いです。

sourceSets { 
    integTest { 
    groovy { 
     compileClasspath += main.output + test.output 
     runtimeClasspath += main.output + test.output 
     srcDir file('src/integTest/groovy') 
    } 
    resources.srcDir file('src/integTest/resources') 
    } 
} 

task integTest(type: Test) { 
    testClassesDir = sourceSets.integTest.output.classesDir 
    classpath = sourceSets.integTest.runtimeClasspath 
} 

UPDATE:追加の依存

ここ関連する構成です。

dependencies { 
    compile "org.codehaus.groovy:groovy-all:2.4.5" 
    compile "log4j:log4j:1.2.17" 
    compile "org.slf4j:slf4j-simple:1.7.12" 
    compile project(':module-loader') 
    testCompile "org.spockframework:spock-core:1.0-groovy-2.4" 
} 
+0

はあなたの依存関係を表示します。 – Alexiy

答えて

0

私はbuild.gradleファイルにこれを追加し、それが今で動作しているようだ:

configurations { 
    integTestCompile.extendsFrom testCompile 
    integTestRuntime.extendsFrom testRuntime 
} 
関連する問題