Development with NetBeans

Portlet development needs the following software installed:

Install NetBeans

Download the NetBeans Java EE version from NetBeans site. The Install Apache Tomcat server option is not necessary to be selected but nevertheless it might be a good idea to have a plain Tomcat installation on the system.

Install Liferay Package

Get the Liferay Tomcat bundle from their download page. Extract it and place somewhere. The directory must be writable to the developer user.

Install Portal Pack Plugin

Although portlets can be developed without this plugin, it is much easier to configure the Liferay server and automatic deployment for rapid testing. This means the actual package can be injected into Liferay portal when modifications are saved. No need to upload the WAR-files nor load something manually.

Configure NetBeans

Test the Setup

The new server should appear in the server list. Right-click on it and choose Start. The initialization takes some time but when it is finished it should display the Liferay initial setup page on http://localhost:8080. Since this is dedicated server, Liferay is located in the root directory and no context path is required.

Configure automatic deployment

Using the Configured Server

To deploy a portlet project to the newly configured server, right-click on project root and choose Properties. From the left-hand pane select Run. From the drop-down list on the right side choose the Liferay server.
Now, when running the project, the portlet should be automatically deployed and available in Liferay’s portlet menu. When the portlet is added to some webpage, it is automatically updated when redeploying.