Wednesday, 10 July 2013

Steps to get IntelliJ working with Liferay portal services

Assumption - Liferay has already been run before with tomcat and everything all set up. Uses Liferay Maven to manage projects.


  1. Download and install IntelliJ (The latest version as of writing is IntelliJ IDEA 12.1.4)
  2. Create a new project and point the project root to the SVN parent folder
  3. In Module settings, type in the name of one of the folder in the SVN parent folder
  4. For existing svn checked-out folders, use 'Import Module...' to add more folder to the IntelliJ project
    1. Use Maven model to import
    2. Tick "Keep project files in" checkbox
  5. For the ones without a proper package, create a new module with the same name and do a 'Import Module...'
  6. For the ones that haven't been check-out from svn, use built-in subversion to check out the folder to a destination folder and 'Import Module'
  7. Select all the modules and do Subversion -> Update Directories
  8. Top left -> Project -> Package - if packages exist here, it means it has been imported to IntelliJ successfully (Automatically import Library Dependencies)


To test that it work:

  • Create a new "workspace" folder - Utilities
  • Create a new file - test.groovy
  • Type "GroupLocalService" and you should have liferay portal services for selection
  • Once selected, it should automatically import the relevant liferay service into the file
  • Do this
    GroupLocalService groupService = GroupLocalServiceUtil.getService();
    groupService.
    Note that the "." at the end is requried
  • and it should have a list of avaiable API for this service.



No comments:

Post a Comment