Added by (Berry) A.W. van Halderen, last edited by (Berry) A.W. van Halderen on Feb 27, 2007  (view change)

Labels:

war war Delete
cms cms Delete
deploy deploy Delete
configuration configuration Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Application Containers are essentially Java-based HTTP webservers that have the infrastructure to run full Java based webservices with servlets, JSP, JNDI and other facilities normally needed by Java-based web applications.  Popular application containers include Tomcat, JavaOne, Glassfish, WebSphere, JBoss.  Application containers offer facilities to better manager the application, ease deployment and provide a default environment from which settings can be loaded for the application.  Deployment using WAR files eases the tasks of system administrators to quickly install and manage webservices by standardizing the way an application is delivered.  Just a single archive containing all of the files required for the application is given to the application container.  These archives have the extension .war and are basically JAR files, with rules on what should be present within them.  This page described how create WAR files for Hippo Cocoon based web sites and Hippo CMS deployments. For Hippo repository turn to the description 2. Hippo Repository Download, Install and Buildand refer to the section on building the repository as a WAR.

 Prerequisites

For be able to create WARs you need the latest source code from the subversion repository of the following components:

  • hippo-cocoon-extensions (for cocoon-2.1.8-improvements and eventcache)
  • hippo-cocoon (for the server and the maven plugin)
  • server-manager
  • hippo-cms and/or
  • hippo-repository, if the CMS or repository are to be build as WARs.

Upgrade your hippo-cocoon using:

maven

Upgrade your hippo-cocoon using:

maven -d plugin plugin:install
rm -rf ~/.maven/cache
maven -d server install
maven -d server jar:install

and upgrade your server-manager using:

maven jar:install

Before building a site

There are a few things to take note of

  1. You need some new, additional settings in your build properties relating to building WAR files;
  2. For a few other properties often present in build properties files a number of limitations exist;
  3. Only a very limited setup of HSQLDB can be used (which is strongly discouraged);
  4. Your site or CMS can only be deployed on the root URL.

Regarding point 1, the following properties are normally added:

maven.war.final.name=${pom.artifactId}.war
maven.final.name=YourSiteName
maven.war.src=${basedir}/src/webservice
maven.ear.src=${basedir}/src/ear
war.displayname=${pom.artifactId}_war
war.weburi=${pom.artifactId}.war
cms.workflow.dir=${basedir}/../workflow
war.contextroot=/

You can freely choose YourSiteName, for which  ${pom.artifactId}  is not a bad choice.

Regarding point 2, you should take into account that:

  • You can only use absolute or context URLs (i.e. starting with context://), relative URLs do not always work;
  • There is a bug currently preventing you to use context URLs for the properties
maven.cocoon.servermanager.configurationlocation
maven.cocoon.servermanager.worklocation
  • which you must currently specify as absolute paths.
  • Specify your cms.types.dir as
    cms.types.dir=${maven.cocoon.extensions.path}types

    and if using custom workflows this directory as

    cms.workflow.dir=${basedir}/../workflow

    Note that this workflow directory either should contain the zip files or has a maven target build which copies your custom workflows in place.

To build a WAR or EAR file

Simply build a war-target build using:

maven clean cocoon:war

Note the target cocoon:wa i.s.o. a war. The same for ear-targets:

maven clean cocoon:ear