Skip to content

Instantly share code, notes, and snippets.

@jfrosch
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfrosch/340c7008269d2233f979 to your computer and use it in GitHub Desktop.
Save jfrosch/340c7008269d2233f979 to your computer and use it in GitHub Desktop.
Build File testing Gradle Grails Plugin
/*
In Windows, running "$gradle test" results in error: "Could not find or load main class org.grails.launcher.Main"
I discovered the plugin was escaping spaces in paths to GRADLE_USER_HOME with %20; i.e.
-cp C:\Users\FirstName%20LastName\.gradle\caches\modules-2\files-2.1\org.grails\grails-launcher\1.1\...\grails-launcher-1.1.jar
This caused the classpath not to be properly set, resulting in the error.
I blogged about this issue at: http://jackfrosch.com
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:2.1.2"
}
}
apply plugin: "grails"
grails {
grailsVersion = '2.4.4' // Specifies the Grails version to use
groovyVersion = '2.3.7' // Specify the Groovy version to use (should match the version that ships with the above Grails version)
springLoadedVersion = '1.2.0.RELEASE' // Specify the Spring Loaded version to use
}
repositories {
jcenter()
grails.central() //Adds the Grails Central Repository for resolving Grails plugins (replaces grailsPlugins(), grailsCentral() from BuildConfig.groovy)
}
dependencies {
// plugins for the build system only
bootstrap "org.grails.plugins:tomcat:7.0.50"
// plugins for the compile step
compile "org.grails.plugins:scaffolding:2.0.1"
compile 'org.grails.plugins:cache:1.1.1'
// plugins needed at runtime but not for compilation
runtime "org.grails.plugins:hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
runtime "org.grails.plugins:database-migration:1.3.8"
runtime "org.grails.plugins:jquery:1.10.2.2"
runtime "org.grails.plugins:resources:1.2.1"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime "org.grails.plugins:zipped-resources:1.0.1"
//runtime "org.grails.plugins:cached-resources:1.1"
//runtime "org.grails.plugins:yui-minify-resources:0.1.5"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment