标签:maven properties maven build clean package
今天在打包项目war文件的时候,突然发现居然每个action包里面的properties文件都没打进来,在网上看了半天终于找到解决方法。
问题:maven执行package命令打包时,src/main/java路径下的properties文件偶尔丢失
解决方式:pom.xml中加入resources配置
<build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> </includes> </resource> <resource> <directory>src/main/resources</directory> </resource> </resources> </build>
说明:
首先了解maven生命周期如下:
生命周期阶段 | 目标 |
process-resources | resources:resources |
compile | compiler:compile |
process-test-resources | resources:testResources |
test-compile | compiler:testCompile |
test | surefire:test |
package | war:war |
install | install:install |
deploy | deploy:deploy |
经测试,
1.当pom中不增加resources配置时,
2.当pom中增加resources配置时
标签:maven properties maven build clean package
原文地址:http://blog.csdn.net/blue_rem/article/details/40396483