【问题标题】:How to set Set Vm Arguements for Grails 2.2.4如何为 Grails 2.2.4 设置 Set Vm Arguements
【发布时间】:2016-03-29 20:15:15
【问题描述】:

我正在使用 Grail 2.2.4,

在 conf/spring/resources.xml 中,我尝试将文件导入为 ${realm}-config.properties,其中领域是 vm 参数,我尝试在 BuildConfig.groovy 中设置 vm 参数,如下所示

grails.tomcat.jvmArgs = ["-Dstage=dev","-Drealm=app"]

但它似乎没有起色。我得到以下错误,

类路径资源[${realm}-config.properties]不存在,无法打开

在 grails 2.2.4 中设置 vm 争论的正确方法是什么?

【问题讨论】:

    标签: grails grails-2.2


    【解决方案1】:

    也许尝试通过 conf/Config.groovy 中处理的环境变量加载您的配置

    def ENV_NAME = "MY_CONFIG"
    grails.config.locations = []
    if (System.getenv(ENV_NAME)) {
        grails.config.locations << "file:" + System.getenv(ENV_NAME)
    }
    else if (System.getProperty(ENV_NAME)) {
        grails.config.locations << "file:" + System.getProperty(ENV_NAME)
    }
    

    【讨论】:

      猜你喜欢
      • 2015-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-14
      • 1970-01-01
      • 2016-04-06
      • 1970-01-01
      相关资源
      最近更新 更多