Welcome to Our Blog

JRebel expands build tool support with new Gradle plugin

As more folks begin looking into the Groovy ecosystem, we’ve been hearing from more developers interesting in using JRebel with Gradle.

As you know, JRebel provides instant builds in addition to eliminating redeploys, but for that special bit of magic to work, we need to generate a rebel.xml to map the project during the build, like our existing Maven plugin.

Recently we’ve implemented a very basic version of the Gradle plugin, which is available from the ZeroTurnaround repository and was tested with Gradle 1.0-milestone-6. So far, we’re keeping things simple (configurability is limited and will only support a limited number of project types, i.e. only jar and war projects), while the work continues.

Of course, one way to improve this plugin and life in general is to hear back from users! So give it a try and tell us on the forum which configuration options you think we be awesome to see in future releases.

STEP 1: Automatically generate rebel.xml at each build

Add this to you build.gradle:

apply plugin: 'rebel'

buildscript {
  repositories {
     mavenLocal()
     mavenCentral()
     mavenRepo(name: 'zt-public-snapshots',
               url: 'http://repos.zeroturnaround.com/nexus/content/groups/zt-public/')
  }

  dependencies {
     classpath group: 'org.zeroturnaround', name: 'gradle-jrebel-plugin', version: '1.0.2-SNAPSHOT'
  }
}

STEP 2: Additional configuration

Add “rebel” element with following parameters to your build.gradle:

rebel {
/*
* alwaysGenerate - default is false
*
* If 'false' - rebel.xml is generated if timestamps of build.gradle and the current rebel.xml file are not equal.
* If 'true' - rebel.xml will always be generated
*/
// alwaysGenerate = "true"

/*
* showGenerated - default is false
*
* If 'true' generated rebel.xml will be printed out in console, so you can immediately see what was generated
*/
// showGenerated = "true"

/*
* rebelXmlDirectory - default is 'build/classes'
*
* Output directory for rebel.xml.
*/
// rebelXmlDirectory = "build/myClasses"

/*
* warSourceDirectory - default is 'src/main/webapp'
*
* The directory with web resources.
*/
// warSourceDirectory = "src/main/myWebapp"
}

STEP 3: Let us know what rocks/sux

As stated above, it’s crucial to hear feedback in order to make improvements, so feel free to post your feedback to our forum or below in the comments section. Have a productive day!

Igor Bljahhin

Igor Bljahhin is a Software Engineer for JRebel at ZeroTurnaround. He is lazy developer, likes copy-paste, likes to use frameworks and does not like to reinvent the wheel. You can connect to Igor via LinkedIn.

More Posts

  • JAX Innovation Awards | Most Innovative Java Technology
  • 19th Annual Jolt Productivity Award
  • 2011 Duke's Choice Award
  • EAS Innovator 2011 Competition Winner
  • 2012 Eclipse Community | New Product Showcase Winner
  • 2012 SD Times 100
  • ITL | Breakthrough of the Year