【发布时间】:2021-03-05 08:27:22
【问题描述】:
我需要了解在什么条件下从文件系统 (FS) 加载模块配置文件。具体我想知道为什么配置中没有加载config.yaml文件?
这是我的src/main/resources/<magnolia-module-name>/config.yaml根据@987654321@和here描述的文件模块结构。
'config':
'gitRepoDirectory': '/Users/asusti/jGit/'
'tempVersionDirectory': '/Users/asusti/temp/'
'excludes':
'green': 'green'
'red': 'red'
我从模块配置中将此配置文件导出为 yaml 并将其复制到上述文件位置。
根据示例here,我也尝试使用这样的config.yaml:
gitRepoDirectory: /Users/asusti/jGit/
excludes:
green: green
red: red
为了测试这一点,我从 config/modules/<magnolia-module-name> 下的配置应用程序中删除了 config content node 并重新启动了 magnolia 实例。我错过了什么?
我正在运行 magnolia 5.7.9.
更新:
按照here的建议,我将config.yaml添加到src/main/resources/mgnl-bootstrap/<magnolia-module-name>/config.modules.<magnolia-module-name>.config.yaml,内容如下。
'config':
'gitRepoDirectory': '/Users/asusti/jGit/'
'jcr:primaryType': 'mgnl:content'
'excludes':
'green': 'green'
'red': 'red'
config文件夹和下面的属性和节点没有安装在config中。
解决方案: 对于引导,我找到了文档here 根据此文档:
All bootstrap files are only imported once!
Webapp-based bootstrap files are imported during the first run of the webapp when the Magnolia instance gets installed.
Module-based bootstrap files are imported during the installation of the module.
If you want to import bootstrap files on every start up of the Magnolia instance or of a module, you must use custom installation tasks which are executed by the Module version handler or Module start up classes.
【问题讨论】:
标签: magnolia