IntelliJ Plugin Development
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.
- Set up plugin-sdk environment. Read Plugins SDK page for more information.
- create plugin using the create command. Example
C:\downloads\liferay\liferay-plugins-sdk-5.2.3\portlets>create portlet-test "My Test Portlet"
- create new project in IntelliJ IDEA.
- File -- New Project
- Create Java project from existing sources
- Browse hard drive to find your "portlet-test" portlet.
- Click Next
- Click Next to accept source directories intelliJ found. (you have no choice here)
- Click next to accept (empty) libraries screen
- Click next to accept intelliJ detected modules
- Click finish to accept facets and complete the wizard.
- When project opens, open the project structure dialog.
- Remove Intellij-detected source directories
- click "add content root" button
- 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
- in project structure, open libraries dialog.
- click "+" button to add new library or hit CTRL-Insert
- give new library a name (portlet)
- accept the module that this new library will be applied to
- click Attach Jar Directories
- find portlet.jar in filesystem. (for example %LIFERAY_HOME%/tomcat/common/lib/ext)
- To test, make an arbitrary change to your source files and use IntelliJ IDEA ANT integration to run the deploy command.