Develop with Intellij



Use the IntelliJ IDE to work on Hippo implementation projects.


Once you have set up and built your project, you probably want to use your IDE to edit the source files and debug your site. This document explains the steps involved in setting up Intellij for this purpose.

IntelliJ Plugins

Hippo Shared Lib Plugin for IntelliJ

This plugin is useful for deploying Hippo projects to an external Tomcat instance from within IntelliJ. It deploys Hippo's shared dependencies to Tomcat's shared library.

Import an Existing Project

From the "File" menu, choose "Open..."

Select the folder that contains your project and click OK.

From the "File" menu, choose "Project Structure..."

Make sure the Project SDK is 1.8 (i.e. Java 8) and click OK.

Enabling Code Completion for FreeMarker Templates

IntelliJ supports code completion for FreeMarker templates. To enable auto completion for the HST tag library and HST content beans, perform the following steps:

  1. Add the following dependencies to the file repository-data/webfiles/pom.xml:​
  2. Add Web Application framework support to the repository-data/webfiles sub project. Do this by right-clicking in the project structure on the folder repository-data/webfiles, then select "Add Framework Support", then select "Java EE/Web Application" and de-select "Create web.xml". IntelliJ then also creates a folder "web" with a sample jsp file, both can be deleted.
  3. Create a new FreeMarker template, for instance repository-data/webfiles/src/main/resources/site/helloworld.ftl and fill it with:
    <#assign hst=JspTaglibs[""] >
    <@hst.defineObjects />
    <#-- @ftlvariable name="document" type="org.example.beans.BaseDocument" -->
    <a href="< hippobean=document />">${document.path}</a>
    IntelliJ will now generate code completion suggestions for the hst tags, and also for the document variable based on the content bean class.

Debug Your Project

By default, debugging is enabled when running your project using

mvn -P

All you need to do, is to attach a debugger to the running application and you can start setting break points.

To attach a debugger to a running Hippo project follow these steps:

From the "Run" menu, choose "Debug..." or alternatively hit Alt+Shift+F9
Choose "Edit configurations..."
Press the + button on the far left top corner of the dialog that appears and choose "Remote"
Fill in a name for the configuration and make sure the port number is 8000


Click "Apply" and then "Debug" to attach the debugger to the running project.