[spock] GradleでSpock動かそうとしたらエラー
Gradleのバージョン
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
build.gradle
apply plugin: 'java' apply plugin: 'groovy' repositories{ mavenCentral() } dependencies{ compile 'org.yaml:snakeyaml:1.12' groovy 'org.codehaus.groovy:groovy-all:2.0.0' testCompile 'org.spockframework:spock-core:0.7-groovy-2.0' }
gradle test したら、以下のエラー。
:compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileTestJava UP-TO-DATE :compileTestGroovy FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':testCompile'. > Could not find group:junit, module:junit-dep, version:4.10. Required by: :SnakeJenkinsConfig:unspecified > org.spockframework:spock-core:0.7-groovy-2.0 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 9.204 secs
build.gradle を以下のように修正したら、うまくいった。
apply plugin: 'java' apply plugin: 'groovy' repositories{ mavenCentral() } dependencies{ compile 'org.yaml:snakeyaml:1.12' groovy 'org.codehaus.groovy:groovy-all:2.0.0' testCompile module('org.spockframework:spock-core:0.7-groovy-2.0'){ dependency('junit:junit:4.11') } }
Gradleのバージョンが古いせいだろうか
GradleでSpock動かそうとしたらエラー2
やっぱりGradleのバージョンが古いのがいけなかったようだ。
------------------------------------------------------------ Gradle 1.4 ------------------------------------------------------------ Gradle build time: 2013年1月28日 3時42分46秒 UTC Groovy: 1.8.6 Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012 Ivy: 2.2.0 JVM: 1.7.0_09 (Oracle Corporation 23.5-b02) OS: Mac OS X 10.7.5 x86_64
:compileJava UP-TO-DATE :compileGroovy :processResources UP-TO-DATE :classes :compileTestJava UP-TO-DATE :compileTestGroovy Download http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.0.5/groovy-all-2.0.5.jar :processTestResources UP-TO-DATE :testClasses :test BUILD SUCCESSFUL Total time: 34.352 secs
しっかりアップデートしていかないとダメですね。