Tuesday, March 27, 2012

Liferay Portal Development Configuration

In an effort to do bug fixes and figure out certain things going wrong without our liferay install, I decided to set up liferay in such a way where I could place breakpoints and change code on the fly. This allows me to create patches in the form of updated class files and replace the class files in the final liferay release(s) to fix bugs unofficialy.

In order to set up the debugging environment the following steps should be taken.

Step 1: Install a Liferay Bundle. I would recommend installing the same version of Liferay that you are acutally using in your production environment. In my case, this is liferay version 6.1, Tomcat Bundle. The latest bundles can be downloaded here.

Step 2: download the latest Liferay IDE. This is an instance of the Eclipse IDE WTP bundled with certain plugins to give it special Liferay functionality, such as being able to start a Liferay Server instance. You may download the latest version of the Liferay IDE here.

Step 3: Install the latest SVN plugin for Eclipse. The easiest way to do this is to select (in the Liferay IDE) "help" -> "Install New Software..." -> and then select "Indigo - http://download.eclipse.org/releases/indigo" as your item in the "Work with:" field. This item may be different depending on your version of the Liferay IDE, but the name will correspond with the name of the Eclipse IDE version that the Liferay IDE is based on. Once the available categories are done loading, simply expand the collaboration section, select "Subversive SVN Team Provider" and proceed to follow the directions after selecting either "next" or "finish." You will also be prompted to install an SVN connector at some point; at this step, simply pick one connector that best matches your enviroment and proceed with the installation. After these steps are all complete and Liferay IDE has restarted, you should be able to add a new SVN server to browse the Liferay source code. You can get more information on the required URLs here. For my version the URL for Liferay's repo is http://svn.liferay.com/repos/public/ and the login credentials are:

user: guest
password:

Step 4: Check out the liferay source code into your workspace. Simply navigate the Liferay SVN server to the TAG matching your target deployment version (this should also be the same version of Liferay that you have specified as the server instance). Select the branch and check out the entire contents.

Step 5:At this time you are ready to define a new Liferay server instance within the Liferay IDE. Select "Create a new Liferay Server" from the toolbar and follow the on screen instructions. Once the server is created, open the server view and tell the server to start. After the server has started, select the option "Open Liferay Portal Home" from the server's available action list.

Now, whenever liferay throws an exception your way, you should be able to access the related code, modify the code, and create your own patches as needed.

Contributors