Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

IntelliJ Plugin Development

Tags: sdk intellij

These are the steps used to get the plugins environment set up in IntelliJ IDEA, an IDE that can be used to develop on Liferay. Allow the wizard to complete with default values and change the project structure after the wizard completes.

  1. Set up plugin-sdk environment. Read Plugins SDK page for more information.
  2. create plugin using the create command. Example
    C:\downloads\liferay\liferay-plugins-sdk-5.2.3\portlets>create portlet-test "My Test Portlet"
  3. create new project in IntelliJ IDEA.
    1. File -- New Project
    2. Create Java project from existing sources
    3. Browse hard drive to find your "portlet-test" portlet.
    4. Click Next
    5. Click Next to accept source directories intelliJ found. (you have no choice here)
    6. Click next to accept (empty) libraries screen
    7. Click next to accept intelliJ detected modules
    8. Click finish to accept facets and complete the wizard.
  4. When project opens, open the project structure dialog.
    1. Remove Intellij-detected source directories
    2. click "add content root" button
    3. add root directory of your portlet (or theme, template, hook, etc.). choosing root directory for source gives access to ALL files needed to edit and build the plugin within IntelliJ IDEA
  5. in project structure, open libraries dialog.
    1. click "+" button to add new library or hit CTRL-Insert
    2. give new library a name (portlet)
    3. accept the module that this new library will be applied to
    4. click Attach Jar Directories
    5. find portlet.jar in filesystem. (for example %LIFERAY_HOME%/tomcat/common/lib/ext)
  6. To test, make an arbitrary change to your source files and use IntelliJ IDEA ANT integration to run the deploy command.
0 Attachments
33749 Views
Average (3 Votes)
The average rating is 1.0 stars out of 5.
Comments