Programming Notes

Liferay Portlets Deployment in IntelliJ IDEA

| Comments

You can develop Liferay portlets with IntelliJ IDEA exactly as in Eclipse Liferay IDE. Follow simple steps:

  1. Create debug configuration in IntelliJ IDEA using Local Tomcat
  2. Configure deployment artifact: add your WAR as yourwar:war exploded and set Application context to /yourwar
  3. Create XML file with name “yourwar.xml” with the following content:
    yourwar.xml
    1
    2
    3
    4
    5
    
    <?xml version="1.0" encoding="UTF-8"?>
    <Context
      docBase="/absolute/path/to/project/yourwar"
      reloadable="false"
      path="/yourwar"/>
    
    Please note, docBase have to be the same as “Output directory” setting in ItelliJ IDEA of the artifact you deploy. Also, path have to be the same as “Application context” in Run/Debug configuration
  4. Create post deployment action that will copy just created XML to Liferay’s autodeploy folder.
  5. As Liferay official wiki suggests, add empty CATALINA_BASE environment variable.

Enjoy automatic deployment, hot-swap and debugging your LIferay application.

Please note, I tested it with IntelliJ IDEA 12.1 and Liferay 6.0.5 on Tomcat 6

Comments