Mar*_*ace 11 maven-2 properties intellij-idea file-not-found
我使用一个从头开始在IntelliJ中创建了一个新项目Maven Module.我没有选择任何特定的原型,我点击完成.项目得到很好的创建,我按照预期在src/main下有java和resources文件夹.
不幸的是,我的应用程序在resources文件夹中找不到任何属性文件,因为它在项目基础文件夹中查找.
我仔细检查了资源文件夹在项目结构中被标记为"源文件夹",我还尝试将以下内容添加到pom.xml中但没有成功:
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
我正在使用Maven 2.2.1和IntelliJ 11.1,有什么想法?
小智 9
Intellij 12中有一个错误请转到设置 - >编译器并取消选中"使用外部构建"复选框 - 它背后的想法是,假设在单独的进程中运行编译器运行速度更快,但事实上是一个错误,当使用maven时,它不会复制资源.
尝试
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
或者在设置 -> 编译器 -> 资源模式下,添加资源模式(即?*.prefs)
| 归档时间: |
|
| 查看次数: |
19153 次 |
| 最近记录: |