Wednesday, October 10, 2012

Set up JRebel on Intellij for Maven project.

What is JReble and what can it do for you?

Step 1:

How to install JRebel plugin on your IDE (Intellij as example)?

Step 2:

Configure JRebel for your maven project.

Add the following snippet to your parent pom.xml. The rebel.xml configuration file will be generated
for each individual sub-module of your maven project.


      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 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.

Step 3:

Set up JRebel for you tomcat.

Create a file in the dir of you TOMCAT_HOME/bin

and add following content into it.
 export CATALINA_OPTS="-javaagent:/home/seaxio/.IdeaIC11/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar $CATALINA_OPTS"  
 `dirname $0`/ $@  

Step 4:

Start debugging.

 Run sh jpda start  

Done. compaile your project (Itellij: ctrl + f9) after every code change.

Do not to redeploy your project and you can see the changes in the fly.

No comments:

Post a Comment