Customized Run Modes

You can also create your own, customized, run modes. These can be combined to cover scenarios such as:

  • author + development

  • publish + test

  • publish + test + golive

  • publish + intranet

  • as required . . .

Customized run modes can also be selected at each startup.

Using samplecontent and nosamplecontent

These modes let you control the use of sample content. The sample content is defined before the quickstart is built and can include packages, configurations, and so on:

  • The samplecontent run mode installs this content (the default mode).

  • The nosamplecontent mode does not install the sample content.

The nosamplecontent run mode is designed for production installations.

Defining configuration properties for a run mode

A collection of values for configuration properties, used for a particular run mode, can be saved in the repository.

The run mode is indicated by a suffix on the folder name. This lets you store all configurations in one repository as. For example:

  • config

    Applicable for all run modes

  • config.author

    Used for author run mode

  • config.publish

    Used for publish run mode

  • config.<run-mode>

    Used for the applicable run mode; for example, config

See OSGi Configuration in the Repository for further details on defining the individual configuration nodes within these folders and for creating configurations for combinations of multiple run modes.

NOTE
For Installation Run Modes (for example, author) the run mode cannot be changed after installation. However, changes to the individual configuration properties will take effect upon restart.

Defining additional bundles to be installed for a run mode

Additional bundles that should be installed for a particular run mode can also be specified. For these definitions, install folders are used to hold the bundles. Again the run mode is indicated by a prefix:

  • install.author
  • install.publish

These folders are of type nt:folder and should contain the appropriate bundle.

Starting CQ with a specific run mode

If you have defined configurations for multiple run modes then you need to define which is to be used upon startup. There are several methods for specifying which run mode to use; the order of resolution is:

When you are using an application server you can also define the run mode in web.xml.

Using the sling.properties file

The sling.properties file can be used to define the required run mode:

  1. Edit the configuration file:

    <cq-installation-dir>/crx-quickstart/conf/sling.properties

  2. Add the following properties; the following example is for author:

    sling.run.modes=author

Using the -r option

A custom run mode can be activated by using the -r option when launching the quickstart. For example, use the following command to launch a AEM instance with run mode set to dev. ``

java -jar cq-56-p4545.jar -r dev

Using a system property in the start script

A system property in the start script can be used to specify the run mode.

  • For example, use the following to launch an instance as a production publish instance in the US:

    -Dsling.run.modes=publish,prod,us

Filename detection - renaming the jar file

The following two installation run modes can be activated by renaming the installation jar file before installation:

  • publish
  • author

The jar file must use the naming convention:

cq5-<run-mode>-p<port-number>

For example, set the publish run mode by naming the jar file:

cq5-publish-p4503

Defining the run mode in web.xml (with Application Server)

When you are using an application server you can also configure the property:

sling.run.modes

in the file:

WEB-INF/web.xml

This is in the AEM war file and should be updated before deployment.

See Installing AEM with an Application Server for further details.

Experience Manager


Elevate and Empower Teams with Agentic AI for Exceptional Experiences

Online | Strategy Keynote | General Audience

Elevate and empower your CX teams with AI that transforms creativity, personalization, and productivity. Discover how Adobe is...

Tue, Mar 18, 1:00 PM PDT (8:00 PM UTC)

Register

Unlocking Content at Scale with Havas POP and Adobe GenStudio

In-person | Session | General Audience

In today’s fast-paced market, a brand's relevance is directly linked to its latest content. With a network of over 23,000 professionals...

Tue, Mar 18, 4:00 PM PDT (11:00 PM UTC)

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more