etc Mapping configurations for different runmodes | Community
Skip to main content
New Participant
July 26, 2019
Solved

etc Mapping configurations for different runmodes

  • July 26, 2019
  • 2 replies
  • 4697 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by akhoury

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

2 replies

akhoury
akhouryAccepted solution
Employee
July 26, 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

Employee
July 26, 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