Hi @ns334 ,
Below are the explanations for your queries.
1. How are different environments mapped to different run modes -
AEM uses run modes to apply environment-specific configurations. These run modes are specified during startup and determine which configuration settings and bundles are activated. For example, you might have run modes like author, publish, dev, prod, or custom ones like intranet. By combining these run modes, you can fine-tune your AEM instance for various scenarios.
2. How does config.dev get mapped to the dev environment?
AEM maps configuration folders to run modes using specific naming conventions. Folders within the repository are suffixed with the run mode they correspond to. For instance:
- config: Applied to all run modes.
- config.author: Applied when the author run mode is active.
- config.dev: Applied when the dev run mode is active.
- config.author.dev: Applied when both author and dev run modes are active.
When the AEM instance starts with the dev run mode, it automatically loads configurations from the config.dev folder. If multiple configuration folders match the active run modes, AEM applies the configuration with the highest number of matching run modes. For example, if both config.author and config.author.dev are present, and the instance is started with author and dev run modes, the settings in config.author.dev will take precedence.
3. What is the underlying mechanism for this mapping?
The underlying mechanism for mapping run modes in Adobe Experience Manager (AEM) is based on how run modes are specified during startup. This can be done using:
- System Properties: -Dsling.run.modes=author,dev when launching the JAR.
- sling.properties File: Adding sling.run.modes=author,dev to sling.properties.
- Command-Line Option: Using -r author,dev while starting AEM.
- Filename Detection: Renaming the JAR file with specific run modes.
Reference- https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/deploying/configuring/configure-runmodes
Regards,