JRebel is a JVM-plugin that makes it possible for Java developers to instantly see any code change made to an app without redeploying. JRebel lets you see code changes instantly, versioning classes and resources individually and updating one at a time instead of as a lump application redeploy.

This will generate JRebel configuration file rebel.xml automatically on every build. If you want to generate the rebel.xml manually run mvn jrebel:generate -Drebel.xml.dir=OUTPUT_DIRECTORY (by default OUTPUT_DIRECTORY is target/classes). Adding -Drebel.generate.show=true will print out generated rebel.xml at info level, so you can immediately see what was generated.

By default, the generated rebel.xml contains absolute paths to your workspace. However if you want to deploy the artifacts for your team to use, you will need to make sure that the paths are relative using a configurable custom property.

Assuming that you have the following project structure in directory c:\projects\:

my-maven-project1
my-jar1
my-war1

You should add the following configuration to the plugin:

<configuration><!-- root is 2 directories up from the jar/war modules --><relativePath>../../</relativePath><!-- use a custom property for specifying root directory (note the double $) set the property in JRebel configuration or as -Dmyproject.root=c:/projects/ --><rootPath>$${myproject.root}</rootPath></configuration>

Now by example you will have c:/projects/my-maven-project1/my-jar1/target/classes as ${myproject.root}/my-maven-project1/my-jar1/target/classes in the rebel.xml. You can set this property as a Java System property (-Dmyproject.root=c:/projects/) or in the JRebel Agent Configuration:

Add into server:

Apache Tomcat 5.x 6.x 7.x

Go to $TOMCAT_HOME/bin and create the file startup-jrebel.sh with the following contents: