【问题标题】:grails placeholder not resolved in external configuration file when running from war从战争运行时,grails 占位符未在外部配置文件中解析
【发布时间】:2012-10-11 19:26:09
【问题描述】:

在我的 grails 应用程序 (grails 1.3.7) 中,我的 Config.groovy 使用 grails.config.locations 添加了一些额外的外部位置。其中一个外部位置是使用属性占位符的属性文件,例如

myprop=${base.dir}/some/other/stuff

这在运行 grails run-app 时有效,但是当我部署到战争时,我收到一条错误消息 Could not resolve placeholder 'base.dir'

关于为什么这会在开发模式下运行而不是在战争中运行的任何想法?

【问题讨论】:

    标签: grails configuration properties


    【解决方案1】:

    我假设你这样做:

    grails -Dgrails.env=myenv war myfile.war
    

    然后在 myenv 中部署到您的应用容器并获取 base.dir 问题..

    尝试在Config.groovy中手动设置base.dir

    environments {
        myenv {
            base.dir = 'expected/base/dir'
        }
    }
    

    希望这会有所帮助..

    【讨论】:

    猜你喜欢
    • 2014-08-18
    • 1970-01-01
    • 1970-01-01
    • 2018-01-26
    • 1970-01-01
    • 2016-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多