Issue

You require additional run modes.

Solution

Run modes allow you to configure CQ and AEM instances for specific purposes. For example, author instances use the author run mode, and publish instances use the publish run mode. 

Once set, run modes are used to tune each instance by defining collections of configuration parameters for each run mode or combination of run modes. Default sets of configurations are applied to all run modes. 

Standard run modes include:

  •  author
  •  publish

Important: The run mode of an instance cannot be changed from author to publish, or vice versa, once a CQ or AEM instance has been installed. Some run modes, such as the author run mode and the publish run mode, are mutually exclusive. If both are specified, only the first run mode is used.

You can use customized run modes as well. They can differentiate instances by purpose, stage of development, or location. Within a development cycle, there can be separate environments for the stages of development. Common stages include development, staging, QA, and production. Run modes can be specified for difference locations and facilities. Examples of more complex run modes include:

  • author, development
  • publish, test
  • author, intranet, us

Set publish or author run mode using quickstart naming

When first installing AEM or CQ, the name of the quickstart jar can be used to determine whether the instance uses the author run mode or the publish run mode.

The naming convention to use for CQ 5.6 and earlier is:

cq-<optional-version-or-identifier>-<standard-run-mode>-<port-number>

The naming convention to for AEM 5.6.1 and later is:

aem-<optional-version-or-indentifier>-<standard-run-mode>-<port-number>

As an example, the quickstart jar for an AEM 6.0 instance running as an author instance with the port of 4502 could be named:

aem-6.0.0.20140515-author-4502.jar

Set up run modes using the Sling properties file

Run modes can be specified within the sling.properties file. This file can be found at <cq-installation-dir>/crx-quickstart/launchpad/sling.properties. Set the property, sling.run.modes, to a comma-delimited list of run modes to apply.

For example:

sling.run.modes=author,test,uk

or 

sling.run.modes=publish,development

Set up run modes using JVM arguments

A JVM argument, -Dsling.run.modes, can be used to specify run modes as well. This argument can be used on the command line, as a system property or within a startup script.

For example:

java -Xmx512m -jar cq-quickstart-5.6.1.jar -Dsling.run.modes=publish,prod,us

Behavior when run modes are specified more than one way

The run mode specified in the naming of the jar file takes precedence. If run modes are not specified in the naming of the jar file, the values in the sling.properties file are used. If run modes are not specified in either the naming of the jar file or the sling.properties file, the system property (or JVM argument) is used.

References

AEM and Adobe CQ documentation

Apache Sling - JCR Installer Provider

Apache Sling - JCR Installer and OSGi Installer

Adobe AEM Documentation: Adding Configurations to the Repository

Run Modes and Configs for Fun and Profit

Applies to

Adobe CQ 5.5 or greater, Adobe AEM 5.6.1 or greater, Adobe AEM 6.0 or greater

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy