简体   繁体   English

Grails 3插件配置

[英]Grails 3 plugins configuration

New to Grails 3- starting to port. Grails 3的新手,开始移植。

Have tried placing config values in application.groovy and application.yml within plugin conf dir to no avail - trying to read values from within plugin service fails. 尝试将配置值放在插件conf目录中的application.groovy和application.yml中无济于事-尝试从插件服务中读取值失败。 Adding values to the main application's application.groovy works. 向主应用程序的application.groovy添加值。

What is the secret here? 这有什么秘诀? Previously I could load specific conf files via config.locations simply by naming them which was nice and simple. 以前,我可以通过config.locations加载特定的conf文件,只需简单地命名它们即可。 I've seen some resolutions that include needing to setup env vars with paths to config files which I'd like to avoid. 我已经看到一些解决方案,其中包括需要设置环境变量以及指向我要避免的配置文件的路径。 Then they set up file URIs for dev and classpath URIs for other envs that will be war packaged - don't really want to do any of this. 然后,他们为将被打包的dev设置了dev的文件URI,为其他env设置了类路径URI-真的不想做任何事情。

Do we no longer have the ability to place config within a plugin and have that automatically merged with the applications config? 我们是否不再能够将配置放置在插件中,并自动将其与应用程序配置合并?

该插件可以在grails-app/conf/plugin.yml提供配置设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM