Package the Delivery Application as ROOT.war

Introduction

Goal

Configure your project to package the delivery application as ROOT.war.

Background

By default Hippo's delivery application (a.k.a. HST) is packaged as site.war and deployed on the context path /site. If you need to deploy your delivery application as ROOT.war some changes to the Maven and Cargo configuration are required.

Maven Configuration

Package Site Module as ROOT.war

The delivery application resides in the site module in your implementation project. To package the application as ROOT.war the finalName of the module's build artifact must be changed from site to ROOT.

In /site/pom.xml change 

<build>
  <finalName>site</finalName> 

into  

 <build>
  <finalName>ROOT</finalName>

Deploy and Run as ROOT.war in Cargo

Now that the name of the delivery application has changed, you must configure your local Maven/Cargo development environment to reflect these changes.

In the project's root pom.xml change

<deployable>
  <location>${project.basedir}/site/target/site.war</location>
  <type>war</type>
  <properties>
    <context>/site</context>
  </properties>
</deployable>

into

<deployable>
  <location>${project.basedir}/site/target/ROOT.war</location>
  <type>war</type>
  <properties>
    <context>/</context>
  <properties>
</deployable> 

Application Configuration

Make sure to do a clean build of your project, run it, and configure the Channels and Audiences perspectives for the delivery application deployed as ROOT.

Creating the Distribution

When creating the project distribution with mvn clean -Pdist, then in case of site as ROOT.war, then make sure to change in the /src/main/assembly/webapps-component.xml  also 

<file>
  <source>site/target/site.war</source>
  <outputDirectory>webapps</outputDirectory>
  <destName>site.war</destName>
</file>

into

<file>
  <source>site/target/ROOT.war</source>
  <outputDirectory>webapps</outputDirectory>
  <destName>ROOT.war</destName>
</file>

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?