pascaldevink's posterous http://pascaldevink.posterous.com Most recent posts at pascaldevink's posterous posterous.com Tue, 29 Mar 2011 06:01:00 -0700 JRebel http://pascaldevink.posterous.com/jrebel http://pascaldevink.posterous.com/jrebel

JRebel maps your project workspace directly to your running application. JRebel versions classes and resources individually, updating one at a time instead of a lump application redeploy. When a developer makes a change to any class or resource in their IDE, the change is immediately reflected in the application, skipping the build and redeploy phases.

JRebel works great by just adding the following plugin to your maven pom.xml:

<plugin>
    <groupId>org.zeroturnaround</groupId>
    <artifactId>jrebel-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>generate-rebel-xml</id>
            <phase>process-resources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
</plugin>

And installing the JRebel app and plugin for your IDE.

Then just create a new catalina script called catalina-jrebel.sh

#!/bin/bash
export JAVA_OPTS="-noverify -javaagent:/home/pascal/apps/JRebel/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Special note: the -noverify option causes a "java.lang.NoClassDefFoundError: Lorg/apache/velocity/app/VelocityEngine" when used with Struts 2. A simple solution is to remove the option, but a better solution is to add the missing velocity jar to your dependencies (adding it to your tomcat libs is the simplest solution).

Resources like JSP, CSS and javascript files will reload automatically, but classes first have to be compiled. You can use maven for that (mvn package), or your IDE (ctrl+f9 in IntelliJ 10)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1249322/91b5dcecd06020f835534512eee654c8.jpeg http://posterous.com/users/heNYfUipKFpzQ Pascal de Vink pascaldevink Pascal de Vink