etc Mapping configurations for different runmodes

manojd55574250

26-07-2019

Hello All,

I want to maintain /etc/map.publish configurations separately for different publisher run modes(dev, stage, prod). Not sure how to achieve that.

Will the following work ? and also how do I test this on different run modes Please advise.

/etc/map.publish.dev

/etc/map.publish.stage

/etc/map.publish.prod

Accepted Solutions (1)

Accepted Solutions (1)

Andrew_Khoury

Employee

26-07-2019

Unfortunately the runmode doesn't get picked up by these automatically.  You have to update the Resource Resolver configuration to point to your custom mapping path.  Per the doc [1]:

You can use /etc/map.publish to hold the configurations for the publish environment. These must then be replicated, and the new location (/etc/map.publish) configured for the Mapping Location of the Apache Sling Resource Resolver of the publish environment.

[1] Official doc reference: Resource Mapping

Instructions:

1. Go to http://{aemhost}/system/console/configMgr/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl

2. Log in as admin

3. Update the Mapping Location

4. Save

5. That would generate an OSGi configuration file in the Oak repository under /apps/system/config.

6. You can then make copies of that configuration with your required paths for each environment under runmode enabled config folders of your application.  For example:

/apps/myapp/config.devpublish/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config

Answers (1)

Answers (1)

Vish_dhaliwal

Employee

26-07-2019

Hello,

Yes, that seems correct. The syntax for defining the mappings is  /etc/map.<runmode>

You can define the runmode in sling.properties file like   sling.run.modes=publish,dev or set it using JVM  parameter like -Dsling.run.modes=publish,dev. Please review articles [1] and [2].

[1] https://helpx.adobe.com/experience-manager/6-3/sites/deploying/using/configure-runmodes.html

[2] https://helpx.adobe.com/experience-manager/kb/RunModeSetUp.html

Regards,

Vishu