Enabling Your Project for Replication
To enable replication in your project, you must configure separate distributions for the replication source and target. This process requires more than adding dependencies and updating configuration files. You need to create distinct CMS web archives for the source and target, as each serves a different role and requires specific components and configuration.
You can create separate modules for the source and target distributions, or use Maven profiles to manage the differences within a single codebase. This guide uses Maven profiles to support code reuse and simplify maintenance.
Replication Source Distribution
The replication source is the cluster where CMS users log in to edit and publish documents. Webmasters also use this environment to modify channels and templates through the Channel Editor. The source distribution includes:
- The CMS application for content editing
- The Site application for previewing and editing channels and templates
- A Hippo Repository to support both applications
To configure the replication source, add the following dependency to your CMS application. This dependency provides the necessary artifacts for running a replication source:
<dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-replication-source-dependencies</artifactId> <type>pom</type> </dependency>
Add this dependency to a Maven profile named replication-source in your CMS pom.xml:
<profile> <id>replication-source</id> <dependencies> <dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-replication-source-dependencies</artifactId> <type>pom</type> </dependency> </dependencies> </profile>
To build the source distribution, run the following commands from your project root:
$ mvn clean install -Preplication-source
$ mvn clean install -Pdist
Replication Target Distribution
The replication target is the cluster deployed in the DMZ that serves the live website. The target distribution includes:
- The CMS application for administrative tasks
- The Site application for delivering web pages
To configure the replication target, add the following dependency to your CMS application. This dependency provides the artifacts required for a replication target:
<dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-replication-target-dependencies</artifactId> <type>pom</type> </dependency>
Add this dependency to a Maven profile named replication-target in your CMS pom.xml:
<profile> <id>replication-target</id> <dependencies> <dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-replication-target-dependencies</artifactId> <type>pom</type> </dependency> </dependencies> </profile>
To build the target distribution, run the following commands from your project root:
$ mvn clean install -Preplication-target
$ mvn clean install -Pdist