-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
打包的问题。如何把apollo-env.properties配置文件从core的jar包移到外面? #584
Comments
启动portal的时候通过-Ddev_meta=xxx可以传入的,可以修改portal的startup.sh中的JAVA_OPTS。 另外,把apollo-env.properties放在和apollo-portal-0.6.2.jar一个目录下不可以吗? |
把apollo-env.properties放在和apollo-portal-0.6.2.jar一个目录下,也不行。 |
呵呵,有可能是这行代码。common包怎么加载配置文件呢?他能覆盖jar包里的properties。 |
application-dev.properties是Spring加载的,可能有些不同,后面研究一下~ |
@myfreeway 研究了一下Spring boot加载配置文件的顺序,发现它会优先从working directory而非classpath加载配置文件,所以我也简单改了一下,可以实现你描述的效果了,参见Pull Request #607。 |
0.7.0已经发布,此issue先关闭了~ |
操作的目的是一个porta配置多套环境的配置。
按照分布式部署指南,我修改scripts/build.sh的
dev_meta=http://dev-config:8080 fat_meta=http://fat-config:8080 uat_meta=http://uat-config:8080 pro_meta=http://pro-config:8080
最后发现这几个参数只被打进apollo-portal-0.6.2-dev.zip/apollo-portal-0.6.2.jar/lib/apollo-core-0.6.2.jar/apollo-env.properties。
我想在外部设置这几个参数的值,应该怎么操作呢?
目前尝试过的办法有以下几种,都无效。
把最终的apollo-env.properties放在
apollo-portal-8070-dev/config/apollo-env.properties
apollo-portal-8070-dev/apollo-env.properties
把配置项放到apollo-portal-8070-dev/config/application-dev.properties
都无效。
谢谢!
The text was updated successfully, but these errors were encountered: