Name: grails-gradle-plugin
Owner: grails
Description: null
Created: 2010-02-10 23:59:29.0
Updated: 2017-06-06 14:53:46.0
Pushed: 2015-09-26 01:23:53.0
Size: 1377
Language: Groovy
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This plugin for Gradle allows you to build Grails projects. To use it, simply include the required JARs via buildscript {}
and 'apply' the plugin:
dscript {
positories {
jcenter()
pendencies {
classpath "org.grails:grails-gradle-plugin:2.1.2"
ion "0.1"
p "example"
y plugin: "grails"
sitories {
ails.central() //creates a maven repo for the Grails Central repository (Core libraries and plugins)
ls {
ailsVersion = '2.4.3'
oovyVersion = '2.3.7'
ringLoadedVersion '1.2.0.RELEASE'
ndencies {
otstrap "org.grails.plugins:tomcat:7.0.50" // No container is deployed by default, so add this
mpile 'org.grails.plugins:asset-pipeline:2.1.3' // Just an example of adding a Grails plugin
You must specify the grails.grailsVersion
property before executing any Grails commands.
The 'grails.groovyVersion' property is a convenience for Grails 2.3.0, it may not work correctly in earlier
versions, so it's best to not use it with version pre-2.3.0. Declaring grails.groovyVersion
will configure a Gradle ResolutionStrategy to modify all requests for groovy-all
to be
for the version specified. Additionally, the ResolutionStrategy will change all requests for groovy
to be groovy-all
The grails-gradle-plugin will populate the bootstrap, compile, and test classpaths with a base set of dependencies for Grails. You need to provide a container plugin such as 'tomcat' to the bootstrap classpath to enable the run-app command.
Warning If you're using a pre-1.3.5 or pre-1.2.4 version of Grails, you'll need to add this runtime dependency to your project's build file:
ime org.aspectj:aspectjrt:1.6.8
Once you have this build file, you can create a Grails application with the 'init' task:
le init
Initialize a new Grails plugin project by running:
le init-plugin
The plugin creates standard tasks that mimic the Java lifecycle:
These tasks are wrapper tasks that declare a dependsOn
to Grails specific tasks. This will allow for further build customization.
You can also access any Grails command by prefixing it with grails-
. For example, to run the application:
le grails-run-app
If you want to pass in some arguments, you can do so via the grailsArgs
project property:
le -PgrailsArgs='--inplace solr' grails-create-plugin
You can also change the environment via the env
project property:
le -PgrailsEnv=prod grails-run-app
You can execute multiple Grails commands in a single step, but bear in mind that if you are passing grailsEnv
or grailsArgs
then each of the
commands will execute with the same values.
Caused by: org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/apache/commons/cli/Options
This happens if your project depends on the groovy
JAR rather than groovy-all
. Change your dependency to the latter and all will be well.
Classloading issues, casting proxy instances to their corresponding interface
This can be a sign of a corrupted Spring-Loaded cache directory. The plugin has spring-loaded cache in $HOME/.grails/.slcache
- try cleaning that directory