简体   繁体   English

Grails 2.0.0.RC1错误Spock测试

[英]Grails 2.0.0.RC1 error Spock testing

I've upgraded a grails project from Grails 1.3.5 to Grails 2.0.0.RC1 and the Spock plugin from 0.5 to 0.6. 我已经将grails项目从Grails 1.3.5升级到Grails 2.0.0.RC1,并将Spock插件从0.5升级到0.6。 and now have this error in tests: 现在在测试中出现此错误:

| Server running. Browse to http://localhost:8080/appName
| Server stopped
| Tests FAILED  - view reports in target\test-reports
| Error Error executing script TestApp: java.lang.RuntimeException: Could
ad class in test type 'spock' (Use --stacktrace to see the full trace)

Did you upgrade your Spock plugin to spock:0.6-SNAPSHOT. 您是否将Spock插件升级到了spock:0.6-SNAPSHOT。 There is a related StackOverflow and it references a JIRA . 有一个相关的StackOverflow ,它引用了JIRA

Extracted is this: 提取的是这样的:

The following in the repositories section: 存储库部分中的以下内容:

mavenRepo "http://m2repo.spockframework.org/snapshots"

And the following plugin dependency definition 以及以下插件依赖项定义

test ":spock:0.6-SNAPSHOT"

0.7 is released now; 0.7现在发布; for grails 2.1/2.0 you can use now: 对于grails 2.1 / 2.0,您现在可以使用:

    grails.project.dependency.resolution = {
  repositories {
    grailsCentral()
    mavenCentral()
  }
  plugins {
    test ":spock:0.7"
  }
}

Try clearing your local grails cache for the project. 尝试清除项目的本地grails缓存。 To do this, 去做这个,

go into ~/.grails/2.0.0RC1/projects (where ~ is your home directory) and delete the project directory. 进入〜/ .grails / 2.0.0RC1 / projects(其中〜是您的主目录)并删除项目目录。

You may also need to clean and build, as a latest build of Spock a couple of days ago required all spock tests to be recompiled . 您可能还需要清理和构建,因为几天前的最新版Spock需要重新编译所有的spock测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM