Last updated by
2 years ago
Page: GrailsDevEnvironment, Version:18
Setting up a Grails development environment
So, you'd like to delve into the Grails source code? Whatever reason you have for doing so, you first need to set yourself up so that you can easily run and debug with the source code version of Grails. Where to start?Pre-requisites
You won't go far without some essential tools and libraries, but to be honest you probably already have all of them:- JDK (1.5+)
- Git client
Downloading the Grails source code
Once you have all the pre-requisite packages installed, the next step is to download the Grails source code. The source code is hosted at github.com in several different git repositories owned by the "grails" github user. To download the source using git, use the "git clone" command followed by the public URL of the repository you want to clone (download). For example, to clone the "grails-core" repository, run the following:git clone http://github.com/grails/grails-core.git
Building and running
After you have made a change to Grails, how do you check that it has had the desired effect?Create the required jars
Running "./gradlew install" will create everything you need to run Grails. This target also skips running the extensive collection of Grails test classes (Grails' 1000+ tests can bring a single core processor to a grinding halt for some time).Once the jars have been built, simply set GRAILS_HOME to the checkout directory and add the "bin" directory to your path.Run the test suite
All you have to do to run the full suite of tests is:./gradlew test
./gradlew -Dtest.single=MappingDslTest grails-test-suite-persistence:test
Debug
To debug Grails run the Grails application using:grails-debug <command>