AEM 配置

AEM Configuration


配置应用于基于 运行 模式的 AEM 实例。在多个 运行 模式和多个配置的情况下,AEM 如何确定要选择的配置文件?
假设以下配置在 AEM 项目中可用,

/apps
  /myproject
    - config
    - config.prod
    - config.author
    - config.active
    - config.prod.active
    - config.prod.author.active

选择或应用于使用 运行 模式创建的 AEM 实例的配置 author,nosamplecontent,prod,active?

是否有任何与配置创建相关的定义规则(或最佳实践)记录在案,我可以在设置项目时参考

谢谢,

这篇文章讨论了它们如何应用的细节: https://helpx.adobe.com/experience-manager/6-4/sites/deploying/using/configuring-osgi.html?cq_ck=1368002864971#ConfigurationDetails

Resolution of multiple Run Modes

For run mode specific configurations, multiple run modes can be combined. For example, you can create configuration folders in the following style:

/apps/*/config../

Configurations in such folders will be applied if all run modes match a run mode defined at startup.

For example, if an instance was started with the run modes author,dev,emea, configuration nodes in /apps//config.emea, /apps//config.author.dev/ and /apps//config.author.emea.dev/ will be applied, while configuration nodes in /apps//config.author.asean/ and /config/author.dev.emea.noldap/ will not be applied.

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

For example, if an instance was started with the run modes author,dev,emea, and both /apps//config.author/ and /apps//config.emea.author/ define a configuration for com.day.cq.wcm.core.impl.VersionManagerImpl, the configuration in/apps/*/config.emea.author/ will be applied.

This rule's granularity is at a PID level. You cannot define some properties for the same PID in/apps//config.author/ and more specific ones in /apps//config.emea.author/ for the same PID. The configuration with the highest number of matching run modes will be effective for the entier PID.

以下是一些最佳做法:

我想,当你使用java -jar 命令创建aem 实例时,你可以提及运行 aem 实例prod、stage、author、publish 等模式

这就是映射到 apps/myproject - config.* 文件夹名称的内容。

配置从上到下拾取。即.prod 将应用于所有 prod 实例并被一级 prod.active 取代。 ...创建配置后,实例 运行ning 需要相应地添加 运行 模式。

如果所有 运行 模式与启动时定义的 运行 模式匹配,将应用此类文件夹中的配置。

根据您的示例,如果实例以 运行 模式 author,nosamplecontent,prod,active

启动
/apps
  /myproject
    - config   ---> will be applied
    - config.prod  ---> will be applied
    - config.author  ----> will be applied
    - config.active    ----> will be applied
    - config.prod.active ----> will be applied
    - config.prod.author.active ---> will be applied

您在这些文件夹中提供的配置通常用于特定的 PID。如果适用于同一 PID 的多个配置,则应用具有最多匹配 运行 模式的配置。

例如如果您在 config.prod 和 config.prod.active 中配置了资源解析器(但不在任何其他文件夹中),那么资源解析器的配置将从 config.prod.active 开始激活,因为匹配应用的 运行 模式数量越多。