JRebel and Gradle Integration
Join the DZone community and get the full member experience.
Join For FreeI have started to use JRebel and believe me, that's a great tool! To configure it, you have to specify the absolute path of your project directories in the configuration file. When working in a team, it is always problematic to have a configuration file with absolute path in version control.
A plugin for maven exists to generate the rebel.xml files but for gradle, nope. Sadly it seems that Zeroturnaround has removed their gradle plugin from their repository.
Hopefully generating a xml file in groovy is a piece of cake. So I have done my own code to generate the rebel.xml file before building the war file.
A plugin for maven exists to generate the rebel.xml files but for gradle, nope. Sadly it seems that Zeroturnaround has removed their gradle plugin from their repository.
Hopefully generating a xml file in groovy is a piece of cake. So I have done my own code to generate the rebel.xml file before building the war file.
task generateRebel << { def rebelFile = sourceSets.main.output.classesDir.absolutePath + '/rebel.xml' def srcWebApp = project.webAppDir.absolutePath def writer = new FileWriter(rebelFile) new MarkupBuilder(writer).application() { classpath{ dir( name:sourceSets.main.output.classesDir.absolutePath ) } web{ link(target:'/'){ dir(name:srcWebApp) } } } } war.dependsOn generateRebelThat's it! Your rebel.xml will be generated on the fly, you just need to activate JRebel on the server!
Gradle
Integration
Opinions expressed by DZone contributors are their own.
Comments