New Liferay Project: JRebel/Liferay Integration

Have you ever wondered about the number of deployments and server restarts you do per day ? For example, a single deployment takes 30 seconds and a server restart takes 1 minute (and these numbers are actually very optimistic).  For a typical scenario of 7 deployments and 2 server restarts per hour you need 60 re-deployments and 20 server  restarts per day. That adds up to almost 1 hour per day, 5 hours per week and 20 hours per month - that's almost 3 working days!.

So you spent 20 hours per month simply by doing nothing, or waiting. Ok, maybe not by doing nothing, there are some creative types who can spend their time being quite useful...

The fact that you end up spending 20 hours each month doing nothing would be definitely interesting to your boss :) But it's also frustrating for developers who cannot work as efficiently as they would like to. Especially in a portal enviroment, there are lots of deployments needed, both to the Application server and Liferay as well. These facts are very often a pain for new developers coming into the portal world.

No need to despair, though. We at mimacom believe that there is always a way to do things better. That's why we have decided to work with Liferay and Zeroturnaround (creators of JRebel) to start a new Liferay project to focus on solving this problem. The goal is to be able to develop with Liferay without the need of redeployments or server restarts.

JRebel/Liferay Integration Project

A few months ago, Neil Griffin posted a blog post about JRebel , which was the inspiration for me to dig into this tool a bit more and start using it. If you want to learn more about this tool, you will find all the important information at the JRebel project page. If you are developing Open Source Software, you can get your licence for free!

As Neil posted in his article, JRebel is works pretty good with Liferay when working on portlet plugins.  However, there are some issues when using JRebel with Liferay hooks and themes. That's why we have decided to create a Liferay project to develop a plugin for JRebel with the following goals:

  • Full support of Liferay theme framework (allow user to edit all static files in the IDE)
  • Full support of Liferay hook framework (allow any changes in any type of hook to be automatically reflected in the portal)
  • Full support of instance changes made in plugin descriptors (portlet.xml,liferay-hook.xml...)

Project page

This project will be the first of hopefully many community-driven projects, and will soon have its own project page on liferay.org. The project page will allow the community to have an entry point to find all relevant information about this project and how to get involved. Additionaly you will be also able to see the latest features of the plugin, report your bugs, and even contribute to the plugin. 

Community input

I hope that with this article, you can see how this tool can make your everyday life easier and save you a lot of time. At the moment we have identified some issues to tackle, but we know, that there are definitely more. We would be very happy if the Liferay community can provide us your experiences, problems, and any feedback related to using this tool. Your feedback and contributions will help us improve the plugin and move Liferay development to a new level, which will allow the whole community to develop application at a speed of light :) So until the project page is  ready, feel free to post your problems, or experiences just by posting comments on this blog.

So from now on, I am not accepting any complaints about the inefficiency of Liferay development and look forward to seeing all of you saving time in your developement tasks!

Blogs
The integration is really simple. The basic setup involves a parameter that needs to be set in setenv.sh (in case you have a tomcat app server) that points to the JRebel installation dir and a rebel.xml file within your project to tell JRebel, which sources to take care of - pretty simple : )

... and of course, you can finetune it - e.g. if you need to configure static sources etc.
Hi Steffen. As I mentioned in the post, the basic integration is no problem. The reason, why we are creating this plugin is missing support for hook/theme frameworks and some other issues. You can use JRebel right now for standard portlet development.
Can't wait to see this project deliver for our community!
Yousri: To set up a project using JRebel is pretty easy, you can just follow the manual at Zeroturnaround web. Once the project page is ready I think we should put some short how-to there as well.
Wow! Awesome initiative!
Thanks a lot, Jan & team
Under IntelliJ, the only wierd thing you have to take care about is setting the environment property "CATALINA_BASE" to a blank value, so deployed Tomcat is able to be aware of the hot deploy folder ($LIFERAY_HOME/deploy). Otherwise when you redeploy your plugin through liferay:deploy maven goal, nothing will happen (only for Maven users)
I don't know if this applies also to Eclipse/Netbeans IDE as we do not use them.
Hi Fran. Actually the JSP hooks does not work at all with JRebel, because of the way, how the framework works. There are also some issues with other type of hooks, when the changes are sometimes not applied. The goal of this plugin also will be to have the possibility to make any change in plugin descriptor and reflect this change to portal without a need of re-deployment.
Sounds very interesting !!!
Waiting for the Plugins ...
Hi Tejas,

The plugin is ready to use.. all the liferay functionality and plugin modules are now supported by the jrebel plugin !