现象:
intellij idea 12-13,web spring 项目,采用 maven 管理;
rebuild project ,$src(src/main/java)下的资源文件,如 properties、xml 没有拷贝到 output path;
原因:
因 为使用 maven 管理项目,pom.xml 中有 <build/> 结点,当 Project Settings -> Compiler 选中 Use external compiler 时会使用该结点的配置,而不使用 Project Structure -> Modules -> Sources 的配置;
解决:
12 可以直接取消 Use external compiler 选中;
13 由于去掉了该选项,只支持外部编译,因此需要在 pom.xml 中手动指定资源文件目录,如:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
</build>