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

前端 未结 11 997
谎友^
谎友^ 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条回答
  •  梦毁少年i
    2021-02-07 00:55

    Frequently it is a criteria that code should be migrated UNCHANGED from test to production. This implies that you may not edit embedded configuation files. Also you may end in a situation where you need to change a deployed configuration - which frequently is very cumbersome. Hence, we leave the configuraiton outside the jars.

    For Java EE applications consider JNDI or a property file in the classpath.

    I have a web application where the configuration is retreived from a neighbor web application simply to separate the two. That turned out to be much easier.

提交回复
热议问题