intellij idea 编译发布时不拷贝资源文件问题解决方案
2016-07-25 00:00
501 查看
现象:
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>
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>
相关文章推荐
- eclipse/intellij idea 远程调试hadoop 2.6.0
- IntelliJ IDEA & Android Studio的调整优化
- Intellij IDEA控制台乱码解决方法
- idea中切换svn地址不起作用
- 使用Ant构建SSH项目(Intellij IDEA版)
- idea常用设置
- Intellij idea使用Git@Osc发布项目(干货)
- IntelliJ IDEA使用Application Server开发普通Java Web项目
- IntelliJ IDEA使用Maven快速开发Java Web项目,并添加JFinal依赖
- 在线安装 IntelliJ IDEA的 golang 插件
- 工具使用【IDEA】---plugins篇
- 工具使用【IDEA】---使用技巧
- Intellij IDEA整理
- 为了响应大家对IDEA 12的支持,特奉上一个解决中文字体问题的好东东
- IntelliJ Idea 常用快捷键列表
- 给大家推荐一个IDEA快捷键等的设置
- 使用IntelliJ IDEA 14和Maven创建java web项目
- IntelliJ Idea 常用快捷键列表
- idea代码调试debug篇
- Intellij idea几个设置