Portal.Node Maven IDE Guide

This guide will describe how to use Gentics Portal.Node with Maven. Please note that this guide is Eclipse IDE specific.

Demo Portal

The Gentics Demoportal contains an example setup for using Portal.Node with Maven in an Eclipse IDE.

The code for the demoportal can be downloaded from our public Github repository.

The specifics of the configuration adaptation are explained in a subsection below.

Handling the configuration

The configuration of this project makes use of many maven features. The demoportal/pom.xml file contains some basic properties that will be used to configure the project. Those properties can be overwritten and enhanced by using maven profiles.

The following profile is mandatory and must be added to the settings.xml of your maven installation.

In Eclipse those settings can be found in the Maven -> User settings dialog. Please note that the settings have to be updated each time they are changed.

<profiles>
    ...
    <profile>
        <id>gentics.license</id>
        <properties>
                <gentics.gpn.licensekey>YOUR_LICENSE_KEY</gentics.gpn.licensekey>
        </properties>
    </profile>
    ...
</profiles>
<activeProfiles>
    <activeProfile>SDK</activeProfile>
    <activeProfile>gentics.license</activeProfile>
</activeProfiles>

The maven.gentics.com maven repository lists additional settings that have to be enabled in order to access the protected maven repository.

The main configuration for the project is located within the demoportal-config module.

This maven module makes use of a predefined profile within the portalnode-webapp-parent maven module. The profile takes care of handling configuration files and sharedlib collection as described below.

img

There are tree main configuration folders.

Foldername Description
portal-conf This folder contains the Gentics Portal.Node configuration files (e.g: default.portal.xml, license.key, portletapplications.xml ..)
eclipse-conf This folder contains the Eclipse specific configuration files. Those files are needed for the Eclipse integration. Maven will replace variables and place the final file in the _/target/eclipseconfiguration/ folder.
server-conf This folder contains the tomcat configuration that will be used when building the final zipfile which contains the tomcat package.

Properties within the portal-conf files will automatically be replaced using the enabled maven properties. The filtered files will be copied to the target directory.

Shared libs

The demoportal-config project is also responsible for creating an output folder that contains all needed shared libs. The output folder is located within demoportal-config/target/sharedlibs.

Libraries from the /demoportal-config/src/main/server-conf/shared/lib directory will also be automatically copied to the demoportal-config/target/sharedlibs folder but it is highly recommended to use the maven dependencies system in order to add libraries.

Webapps

The demoportal contains the following webapps:

  • demoportal-webapp

This is the main webapp. It contains the viewportlets, custom portlets and static content for the demoportal.

  • demoportal-portalnode-webapp / demoportal-cas-portalnode-webapp

The portalnode webapp is a maven module that represents a maven overlay. This demo project uses the maven war plugin overlay functionality to create an overlay by using the provided maven dependency.

The demoportal-cas-portalnode-webapp module is a customized portalnode overlay that shows how additional servlet filter can be added to the Gentics Portal.Node Webapp.

  • demoportal-genticsimagestore-webapp

This webapp represents an overlay for the GenticsImageStore webapp. The way how this overlay is constructed is similar to the Gentics Portal.Node webapp.