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

前端 未结 11 986
谎友^
谎友^ 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 01:15

    Option D. In different environments you may need to specify want to specify environmental properties such as connecting to the database or proxy etc.

    Other thing worth noting is that in production you may want to quickly change a property without having to prepackage a jar or replace the properties file in the jar.

    E.g. The database server is fallen over and you need to point to a different server (if not using a load balancer of the databases). So all you need to do is replace the database properties and restart. You save a lot of time there.

提交回复
热议问题