Skip to content

Instantly share code, notes, and snippets.

@uris77
Created August 21, 2013 23:37
Show Gist options
  • Save uris77/6301552 to your computer and use it in GitHub Desktop.
Save uris77/6301552 to your computer and use it in GitHub Desktop.
Exclude from production.
if(System.getProperty('grails.env') == 'test') {
test(':spock:0.7') {
excludes 'spock-grails-support', 'hibernate', 'grails-hibernate'
}
test ':code-coverage:1.2.5'
}
@pledbrook
Copy link

One downside to this approach is that Grails caches its dependencies (see the .resolve file in the working directory). So switching between environments may introduce subtle problems unless you force a dependency refresh each time.

My preferred approach is to add an eventCreateWarStart handler to the build that strips out the test dependencies before packaging the WAR. It's also pretty hacky 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment