Grails 2.0.0.RC1 错误 Spock 测试

发布于 2024-12-11 14:16:06 字数 393 浏览 0 评论 0原文

我已将 grails 项目从 Grails 1.3.5 升级到 Grails 2.0.0.RC1,并将 Spock 插件从 0.5 升级到 0.6。现在在测试中出现此错误:

| 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)

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. 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

转瞬即逝 2024-12-18 14:16:06

您是否将 Spock 插件升级到 spock:0.6-SNAPSHOT。有一个相关的 StackOverflow ,它引用了

提取的是这样的:

存储库部分中的以下内容:

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

以及以下插件依赖项定义

test ":spock:0.6-SNAPSHOT"

Did you upgrade your Spock plugin to spock:0.6-SNAPSHOT. There is a related StackOverflow and it references a 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"
葬花如无物 2024-12-18 14:16:06

尝试清除项目的本地 Grails 缓存。为此,

请进入 ~/.grails/2.0.0RC1/projects(其中 ~ 是您的主目录)并删除项目目录。

您可能还需要清理和构建,因为几天前需要最新版本的 Spock 所有 spock 测试都要重新编译

Try clearing your local grails cache for the project. To do this,

go into ~/.grails/2.0.0RC1/projects (where ~ is your home directory) and delete the project directory.

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.

烟雨扶苏 2024-12-18 14:16:06

0.7现已发布;对于 grails 2.1/2.0,您现在可以使用:

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

0.7 is released now; for grails 2.1/2.0 you can use now:

    grails.project.dependency.resolution = {
  repositories {
    grailsCentral()
    mavenCentral()
  }
  plugins {
    test ":spock:0.7"
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文