我使用 Grails 1.3.7 创建了一个简单的 hello world grails 应用程序:
grails create-app hello
grails create-controller hello
然后我尝试使用以下方法安装 spock 插件:
grails install-plugin spock
我得到以下信息:
Error loading event script from file [/Users/wholladay/.grails/1.3.7/projects/hello/plugins/spock-0.6/scripts/_Events.groovy] startup failed:
Could not instantiate global transform class org.spockframework.compiler.SpockTransform specified at jar:file:/Users/wholladay/.ivy2/cache/org.spockframework/spock-core/jars/spock-core-0.6-groovy-1.8.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception org.spockframework.util.IncompatibleGroovyVersionException: The Spock compiler plugin cannot execute because Spock 0.6.0-groovy-1.8 is not compatible with Groovy 1.7.8. For more information, see http://versioninfo.spockframework.org
Spock location: file:/Users/wholladay/.ivy2/cache/org.spockframework/spock-core/jars/spock-core-0.6-groovy-1.8.jar
Groovy location: file:/usr/local/Cellar/grails/current/lib/groovy-all-1.7.8.jar
所以我去了:http: //versioninfo.spockframework.org并注意到 spock 有一个 0.6-groovy-1.7 版本。所以我尝试了:
grails install-plugin spock 0.6-groovy-1.7
但后来我收到以下错误:
Error resolving plugin [name:spock, group:org.grails.plugins, version:0.6-groovy-1.7].
未找到名称 [spock] 和版本 [0.6-groovy-1.7] 的插件
有任何想法吗?