Runmode Resolution

TIP
AEM 6.x supports custom runmodes, however AEM as a Cloud Service does not. AEM as a Cloud Service support an exact set of runmodes. Any variation in OSGi configurations between AEM as a Cloud Service environments must be handled using OSGi configuration environment variables.

Specific OSGi configurations can be targeted to specific AEM instances by using runmodes. To use runmode, create config folders under /apps/example (where example is your project name), in the format:

/apps/example/config.<author|publish>.<dev|stage|prod>/

Any OSGi configurations in such folders are used if the runmodes defined in the config folder name match the runmodes used by AEM.

For example, if AEM is using the runmodes author and dev, configuration nodes in /apps/example/config.author/ and /apps/example/config.author.dev/ are applied, while configuration nodes in /apps/example/config.publish/ and /apps/example/config.author.stage/ are not applied.

If multiple configurations for the same PID are applicable, the configuration with the highest number of matching run modes is applied.

This rule’s granularity is at a PID level. This means you cannot define some properties for the same PID in /apps/example/config.author/ and more specific ones in /apps/example/config.author.dev/ for the same PID. The configuration with the highest number of matching runmodes is effective for the entire PID.

NOTE
A config.preview OSGi configuration folder cannot be declared in the same way a config.publish can be declared folder. Instead, the preview tier inherits its OSGi configuration from the publish tier’s values.

When developing locally, a runmode startup parameter, -r, is used to specify the runmode OSGI configuration.

$ java -jar aem-sdk-quickstart-xxxx.x.xxx.xxxx-xxxx.jar -r publish,dev