使用maven package打包專案時出現配置檔案丟失的現象,此類問題解決辦法如下:
在web專案pom.xml 檔案中新增如下:
在<build>標籤中新增如下配置:
1 <resources> 2 <resource> 3 <directory>config</directory> 4 <includes> 5 <include>**/*.properties</include> 6 <include>**/*.xml</include> 7 </includes> 8 <filtering>true</filtering> 9 </resource> 10 </resources>
說明:<include>標籤中配置自己專案中配置檔案的字尾名稱就闊以;
完畢!
include