Toggle jrebel with a cygwin bash function and maven


I’m using java rebel for web development with maven.

Sometimes I would run jetty with jrebel sometimes without.

For that I’m using two simple bash functions:

# ~/.bashrc

#
# Maven options
#
export INTERNAL_MAVEN_OPTS="-Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m"

#
# Java Rebel
#
export JAVA_REBEL="-Drebel.spring_plugin=true -noverify -javaagent:D:/tools/javarebel/jrebel.jar -Drebel.packages=de.ahoehma"

function jrebel_on() {
 export MAVEN_OPTS="$INTERNAL_MAVEN_OPTS $JAVA_REBEL"
}

function jrebel_off() {
 export MAVEN_OPTS="$INTERNAL_MAVEN_OPTS"
}

Now its very simple to enable

$ jrebel_on

or disable jrebel

$ jrebel_off
About these ads