Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can JRebel redeploy changes in Maven dependencies?

So I have a multi module Maven web app running in eclipse and tomcat with wtp.

However the deployment of the application takes some time: building sub modules if changed and starting the application takes also a couple of minutes. Thus I am thinking of using JRebel to speed up this whole process. But I do not know if JRebel can really help me. Most of the time I am working in the submodules. So the changes in the dependencies need to be deployed in my running web app.

I read on http://en.wikipedia.org/wiki/JRebel that updates in JARs are just ignored. Is this still true? I saw there are some kind of maven plugins for JRebel and Eclipse plugins. Can they manage this whole process or am I wasting my time?

like image 560
suicide Avatar asked May 23 '11 09:05

suicide


1 Answers

The information at Wikipedia page is way too old

It depends what you would like to do. If you have submodules, I assume that these are JARs included to WEB-INF/lib of your application? In that case every individual modules should have a dedicated rebel.xml configuration file as follows:

myapp.war
   `- WEB-INF
       |- classes
       |     `- rebel.xml   &lt-- required to map the web app classes and resources 
       `- lib
           |- mylib1.jar
           |      `- rebel.xml  &lt-- maps mylib1.jar classes  
           |             
           |- mylib2.jar
           |      `- rebel.xml  &lt-- maps mylib2.jar classes 
           |- ...
           `- mylibN.jar

This should be the correct way in case you work with the souce code of your submodules. But if you want just to swap jars it is also possible if you map those in rebel.xml of your web app. Take a look at the reference manual for this:

http://manuals.zeroturnaround.com/jrebel/standalone/config.html

As you're using maven, it could be wise to generate rebel.xml files using JRebel maven plugin (just add the code snippet to your pom.xml):

http://manuals.zeroturnaround.com/jrebel/standalone/config.html#maven

like image 137
Anton Arhipov Avatar answered Sep 28 '22 11:09

Anton Arhipov