“Using Spring Tool Suite (STS) for Liferay Development” is the first blog in a series that researches the usability of STS in the Liferay Development process. One might ask: Why not to use the Liferay Development Studio? For one thing, I dislike Ant. All my recent projects have used Maven. There is not a good reason to revert to ancient history and use Ant. Even so, Maven is treated like a red-headed stepchild by Liferay. The Liferay Maven plugin helps with initial project configuration, start of development, and deployment.
INSTALLATION OF SPRING TOOL SUITE
The installation of STS is fairly straightforward. Just download the latest version from http://www.springsource.org/spring-tool-suite-download. As of this blog, the latest version is STS 3.2.0. For the purposes of this blog series, the Spring Source development environment was installed in /home/isosdev/springsource.
INSTALLATION OF LIFERAY PORTAL AND SERVER SETUP
For the Liferay installation I choose Tomcat and the Liferay Glassfish bundle. The Glassfish bundle was chosen primarily because all of the documentation refers to the Liferay Tomcat bundle. Additionally, the Liferay IDE is only available for the Tomcat version.
Download the following artifacts from http://www.liferay.com/downloads/liferay-portal/available-releases
- Liferay Portal 6.1 Community Edition 6.1 CE GA2 Bundled with Tomcat
- Liferay Portal 6.1 Community Edition 6.1 CE GA2 Bundled with Glassfish
- Liferay Portal 6.1 Community Edition 6.1 CE GA2 Plugin SDK [Optional]
I extracted the downloaded files to /home/isosdev/liferay. Once the files are downloaded, we can start to set up the servers in STS.
Startup STS in the default Spring perspective. We will be using this perspective for that exercise. First, in the lower left corner create a new server.
Create a Tomcat Server Instance
Create a new Tomcat 7 Server and point to the Liferay Tomcat folder:
Next we have to configure the server. Open the Server Configuration and change the following option:
- Change the “Server Location” to “Use Tomcat Installation”
- Increase the timeouts for start and stop to 400 and 240, respectively.
- Click “Open Launch Configuration” and add the following settings to the VM Arguments
-Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m
Start the server after these changes and let Liferay complete its installation.
Create a Glassfish Server Instance
If you want to use the Glassfish instance for Liferay development, you need to install the Eclipse Glassfish plugin. The easiest way to do that is using the Eclipse Marketplace. Make sure you select the correct plugin version.
After the installation has completed, create a new server similar to the Tomcat server. Point the Application Server Directory to the proper Liferay Glassfish folder and press ‘Finish’.
The Glassfish server does not require any special configuration settings. Just start the server to complete the Liferay installation.
How to continue
Now we have a clean configuration of Spring Tool Suite and we can test or Liferay portlets and hooks in the Tomcat and Glassfish environment. In next part of the series I will take a closer look at the Maven 3 configurations for Liferay Development.