0
votes

I'd like to use the Spock plugin for my Grails project. The problem that I'm having is that GGTS doesn't configure the build path. So I can generate the following integration test in GGTS, but it will then complain about not being able to find the grails.plugin.spock.IntegrationSpec package.

package junk

import grails.plugin.spock.IntegrationSpec

class MyIntegrationTestSpec extends IntegrationSpec {
    def setup() {
    }

    def cleanup() {
    }

    void "test something"() {
    }
}

I've used both the Grails Plugin manager and editing the BuildConfig.groovy file (like the plugin documentation says to do). I've done a Grails Refresh Dependencies on my project. I even did a grails clean and grails compile. Nothing seems to work.

1
can you post your buildConfig, where you are adding the plugin? - Alidad

1 Answers

0
votes

The Spock plugin page explains how to configure your BuildConfig.groovy:

grails.project.dependency.resolution = {
  repositories {
    grailsCentral()
    mavenCentral()
  }
  dependencies {
    test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
  }
  plugins {
    test(":spock:0.7") {
      exclude "spock-grails-support"
    }
  }
}

After that you need to run:

grails compile --refresh-dependencies

Or in STS:

right click in the project > grails tools > refresh dependencies