JRebel Setup

JRebel is a Java Virtual Machine plugin that enables instant reloading of changes made to a Java class file as well as some property files and static files. We use it heavily in our develop of Broadleaf as it prevents the need for having to restart your server every time you make a change to a file.

Generally, our recommendation for JRebel is the newest. JRebel is a bit of a beast in that it can be volatile and they sometimes introduce problems. Generally, however, the advantages of features, bug fixes and performance improvements that are achieved when staying up-to-date outweigh occasional introduced issues.

Using JRebel

We have provided an Ant task in the starter project called jetty-demo-jrebel. This will start up your server with JRebel instrumentation. The only prerequisite is that you specify the proper path to your JRebel JAR file in build.properties like so:

jrebel.path=/usr/lib/jrebel/jrebel.jar

Now, when you start up the project with the jetty-demo-jrebel target, you should see the following output in your console:

[artifact:mvn] JRebel: Directory '/DemoSite/site/src/main/resources' will be monitored for changes.
[artifact:mvn] JRebel: Directory '/DemoSite/site/target/mycompany/WEB-INF/classes' will be monitored for changes.
[artifact:mvn] JRebel: Directory '/DemoSite/site/src/main/webapp' will be monitored for changes.
[artifact:mvn] JRebel: Directory '/DemoSite/core/src/main/resources' will be monitored for changes.
[artifact:mvn] JRebel: Directory '/DemoSite/core/target/classes' will be monitored for changes.

That means JRebel instrumentation is on and you can live-edit your project!