0
votes

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

3 Answers

1
votes

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"
0
votes

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.

0
votes

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"
  }
}