Grails 内联插件:无法升级通过 BuildConfig.groovy 配置的插件
我们的应用程序分为一个主应用程序和一些插件。我们通过 BuildConfig.groovy 文件使用内联插件。当需要对整个生产进行 WAR 时,我收到以下消息:
您无法升级以下插件 通过 BuildConfig.groovy 配置, 删除配置以继续。
然后 Grails 想要卸载该插件,因为它在 application.properties 中找不到它。但在开发过程中,将其放在 application.properties 中会导致问题。那么,当我们准备好创建生产 WAR 时,我们如何解决这个问题,而不是每次都在 BuildConfig.groovy 中注释插件呢?
Our app is split into a main application and a few plugins. We're using inline plugins via the BuildConfig.groovy file. When it is time to WAR the whole thing up for production I'm getting the following message:
You cannot upgrade a plugin that is
configured via BuildConfig.groovy,
remove the configuration to continue.
And then Grails wants to uninstall the plugin because it can't find it in application.properties. But during development, having it in application.properties causes issues. So when we're ready to create a production WAR, how do we work around this without commenting the plugins in BuildConfig.groovy every time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BuildConfig.groovy 在运行过程的早期被读取,因此并非所有环境数据都可用。但是,它被解释为常规的 groovy 脚本,因此您可以尝试利用 war 任务在生产环境中运行的事实:
BuildConfig.groovy is read rather early in the run process, so not all of environment data is yet available. However, it is interpreted as a regular groovy script, so you could try taking advantage of the fact that the war task is run in production environment: