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

前端 未结 11 991
谎友^
谎友^ 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:50

    I develop J2EE applications using Spring. I was running around the same problem quite a long time and then found a solution. My problem was to specify the database properties in a properties file outside the war file that I deploy. The solution I found to this is to use the PropertyPlaceholderConfigurer and specify the location property to locate your system location as this,

    This was quite simple and it worked just fine !

提交回复
热议问题