2

我有一个有四个构建路径的 Maven 项目

src/main/java
src/main/resources
src/test/java
src/test/resources

但是当我在eclipse中执行“Maven->更新项目配置”时,构建路径“src/main/resources”被删除并保留为简单文件夹。

知道为什么吗?

4

2 回答 2

0

Which version of m2e are you using?

I currently am using m2e 1.2, the latest N release.

For your maven configuration, just note:

  • Don't specify your build paths: m2e & Maven will recognise those are part of the build paths. This is defined in Maven's internal super-pom

  • src/main/resources is on the build path, but is not a source directory. Meaning, Eclipse may not show it as being on Java's source path within your project, but any files added there are included in the built package / on execution. Therefore, being just 'simple' folders is correct.

于 2012-08-09T01:44:49.137 回答
0

如果您希望将您的src/main/resources文件夹映射为 eclipse 中的源文件夹,只需在.classpath项目文件中添加以下行:

<classpathentry kind="src" path="src/main/resources"/>
于 2012-08-09T20:59:16.610 回答