Coder Social home page Coder Social logo

Comments (7)

nobodyiam avatar nobodyiam commented on May 22, 2024

启动portal的时候通过-Ddev_meta=xxx可以传入的,可以修改portal的startup.sh中的JAVA_OPTS。

另外,把apollo-env.properties放在和apollo-portal-0.6.2.jar一个目录下不可以吗?

from apollo.

myfreeway avatar myfreeway commented on May 22, 2024

把apollo-env.properties放在和apollo-portal-0.6.2.jar一个目录下,也不行。
经测试,发现【启动portal的时候通过-Ddev_meta=xxx可以传入的,可以修改portal的startup.sh中的JAVA_OPTS。】这样才可以。
感觉有点不合逻辑。我把application-dev.properties放到config目录里,可以覆盖common包的配置文件。资料也说config的配置文件优先级最高。但是不知道为什么core包的配置文件覆盖不了。

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

可能是加载配置文件的姿势不对,不过只是猜测

https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/ResourceUtils.java#L21

from apollo.

myfreeway avatar myfreeway commented on May 22, 2024

呵呵,有可能是这行代码。common包怎么加载配置文件呢?他能覆盖jar包里的properties。

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

application-dev.properties是Spring加载的,可能有些不同,后面研究一下~

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

@myfreeway 研究了一下Spring boot加载配置文件的顺序,发现它会优先从working directory而非classpath加载配置文件,所以我也简单改了一下,可以实现你描述的效果了,参见Pull Request #607

from apollo.

nobodyiam avatar nobodyiam commented on May 22, 2024

0.7.0已经发布,此issue先关闭了~

from apollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.