Grails Development with Eclipse

Grails Development with Eclipse

By Sergio del Amo Caballero

March 2, 2018


In this blog post, we show the steps necessary to set up Eclipse IDE to develop Grails 3 applications.

Groovy Eclipse

First step is to install Groovy Eclipse. Check the installation instructions.

Once, you have setup Groovy Eclipse setup the Compiler to use Groovy 2.4.13; the version used by the latest stable release of Grails 3.3.2.

Groovy Compiler

Eclipse Spock Plugin

Install Eclipse Spock Plugin

Spock

Buildship Gradle plugin

Install Buildship Gradle plugin.

Buildship Gradle

We are going to rely on Gradle tasks to drive our Grails development in Eclipse. Thus, you may want to enable Gradle views.

Gradle Views

Gradle Tips

When you work often with Gradle it becomes useful to get a verbose output while you run your tests:

tasks.withType(Test) {
      beforeTest { descriptor -> logger.quiet " -- $descriptor" }
     testLogging {
         events "passed", "skipped", "failed"
         exceptionFormat 'full'
     }
 }

Common Grails Gradle Tasks

Run your app
./gradlew bootRun
Run unit tests
./gradlew test
Run integration/functional tests
./gradlew integrationTest
Run ALL tests unit/integration/functional
./gradlew check
Clean
./gradlew clean
Build your artifacts
./gradlew assemble
Dependency Report:
./gradlew dependencies
secret