Maven 遇到配置檔案無法匯出或者生效的問題
阿新 • • 發佈:2021-11-06
在Maven中,由於約定大於配置,在學習工作中可能會遇到我們寫的配置檔案,無法被匯出或者生效的問題。
解決方法:
<!--在build中配置resources,來防止我們資源匯出失敗的問題--> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build>