This tutorial is based on IDEA Ultimate, the commercial version of IntelliJ IDEA. The steps described in this tutorial may differ according to the version of IntelliJ IDEA version you are using.
Create application server
Note that the runtime configuration described here requires that Tomcat server is installed on the system. The Community Edition of IDEA has no direct support for specific application servers. However, Tomcat is included in both the Community and Enterprise editions of Magnolia CMS.
1. From the IntelliJ IDEA main menu select File > Settings.
2. Under Application Servers, click + and select Tomcat Server.
3. Select the directory containing the Tomcat installation that you require.
4. Enter a descriptive Name and click OK to save your newly created application server.
Create runtime configuration
- Select Run > Edit Configurations...
2. Click + and select Tomcat Server > Local.
3. Enter the Server details.
3. On the Server Tab, enter a descriptive Name in the Edit field.
4. Add the configuration details:
Select the server
Select if you want IDEA to automatically start the browser after building the project
Ensure that you assign sufficient memory for Magnolia CMS.
Before Launch area
Select the Make and Build checkboxes.
4. Ensure that the Deployment tab contains the correct war file.
5. Click OK to save your runtime configuration
6. Now that you have an entry in the IDEA toolbar, you can run, debug or run with coverage.
7. After building and startup, you can access Magnolia CMS at http://localhost:8080/
IDEA Community Edition
As you need Maven for executing the Tomcat server, you first need to adjust the Maven build script.
1. In the IDEA project pane expand the magnolia-empty-webapp and double-click on pom.xml located in this directory for editing.
2. Add the following lines of code to your pom.xml in the section between <build> / <plugins>.
3. Expand the Maven pane in IDEA.
4. Right click on the Maven project magnolia-empty-webapp and select Reimport.
5. In the Maven empty-magnolia-webapp project expand Plugins > tomcat7.
6. Right click on the tomcat7 node and select Run Maven Build from the submenu. It also possible to use tomcat6.
7) You can now access Magnolia CMS at http://localhost:8080/magnolia-empty-webapp/
Adding a run target
Integrate the Maven plugin into your IDEA run menu.
1. From the IDEA main menu select Run > Edit Configurations
2. Click + and select Maven from the Add New Configuration list.
3. Enter a descriptive Name for your configuration
4. Supply Parameters.
Select Maven project where the magnolia-empty-webapp is located
Before Launch area
Select the Make checkbox.
5. Supply Runner tab configuration details:
6. To avoid memory leaks, best practice is to increase the available memory for Magnolia CMS. To adjust the memory values, clear the Use project settings checkbox.
7. Enter the VM Options you want to use, making sake sure to select the project JRE from the select list.
6. Click OK to save your settings
Now you have an entry in the IDEA toolbar you can select to run or debug - just choose the appropriate button or menu entry.
After choosing the run / debug options you can access Magnolia using the URL http://localhost:8080/magnolia-empty-webapp/.
No Java runtime defined
If your code does not compile, check that a runtime for Java is set. (The likely reason for this is that you have installed a more recent JDK than the Magnolia CMS was developed with.)
To select the appropriate Java runtime:
1. From the IDEA main menu select File > Project Structure ...
2. From Project select a valid Projekt SDK