Is it bad practice to include properties/configuaration files within jars?

前端 未结 11 985
谎友^
谎友^ 2021-02-07 00:34

For example:

MyApp is a web app that contains a properties file (server.properties) that describes config data (e.g. server names) for the app. In the development phase

11条回答
  •  一生所求
    2021-02-07 00:51

    I'd go with D.

    Try to load the properties files from outside the .jar then, if that fails, load the properties built into the jar.

    This lets you push out a "ready made" configuration with each build (also reduces the complexity of a deployment, if by just one file), while also making overriding configurations possible and reasonably simple.

提交回复
热议问题