當我在eclipse中啓動我的應用程序時,在src/main/resources
文件夾中有一個屬性文件是沒有問題的。當我運行maven install
時,藉助maven程序集將此屬性文件放入config
文件夾中。所以以下問題:何處放置屬性文件(與maven程序集有關)
並在Eclipse工作,我訪問屬性與只是文件:
File propsFile = new File("src/main/resources/settings.properties");
maven install
後,我再也無法達到,當然這個文件。但是,哪個工作流程最好,在我的eclipse開發期間和maven install
之後到達文件,而不是兩次?!
maven install
後,我的組裝結構如下:
application folder
|----bin
|----batch file to start my application
|----lib
|----my application jar
|----other dependencies jars
|----config
|----settings.properties
非常感謝事先已經:)
:通過
ClassLoader.getResourceAsStream
更換使用File
API?通過Maven?通過一個簡單的系統腳本? –是的,使用.cmd文件... – pixelstuermer