How to prepare Eclipse 4.5 Mars for Groovy and Grails 3 development

Today I faced small confusion how to configure my Eclipse to use JRebel with Grails 3 framework. This is step by step configuration.

  1. Get ready with your eclipse on fedora 22 and gnome shell (I’m using sts-3.7.0.RELEASE);
  2. Install Gradle IDE Plugin;
    Screenshot from 2015-09-30 10-25-49
  3. Install JRebel – it’s just a tool to autoreloading classes and spring beans ;-);
    Screenshot from 2015-10-02 10-49-40
  4. Install Groovy 2.4 support from GitHub, (eclipse 4.5 Mars);
    Screenshot from 2015-10-02 10-43-57
  5. Create your Grails 3 application
    grails create-app hello-world --profile=web
    cd hello-world
    grails
    grails> create-controller homePage
  6. Import project into eclipse;
  7. Edit gradle.build file (to add JRebel compatibility), documentation at GitHub:
    buildscript {
      repositories {
         ...
         mavenCentral()
      }
    
      dependencies {
         ...
         classpath group: 'org.zeroturnaround', name: 'gradle-jrebel-plugin', version: '1.1.2'
      }
    }
    ...
    apply plugin: 'rebel'
    ...
    build.dependsOn(generateRebel)
    
  8. Run “gradle generateRebel” -> generate rebel.xml file
    1. In eclipse, Window -> Show view -> Other -> Select Gradle -> Gradle Tasks
      Screenshot from 2015-10-02 15-06-47
    2. The file is generated under this location: build/classes/main/rebel.xml

During the next few days I will publish how to run Grails 3 with JRebel:

  1. From command line without JRebel
  2. From command line with JRebel
  3. From eclipse as a Spring Boot Application without JRebel
  4. From eclipse as a Spring Boot Application with JRebel