2

I have a maven project that have four build path

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

but when I perform, in eclipse, "Maven->Update Project Configuration",the build path "src/main/resources" is removed and stay as simple folders.

Any idea why?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302

2 Answers2

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.

Michael
  • 1,014
  • 1
  • 8
  • 23
  • Strange, older versions of m2e I am using, DO put src/main/resources as source directory. Does such behavior changed or what? – Adrian Shum Aug 09 '12 at 03:18
  • I believe it has yes. I remember when it used to, but to be honest, it's not necessary and just adds clutter. Didn't like it at first, but it's nice now. :) – Michael Aug 09 '12 at 03:20
0

If you want your src/main/resources folder to be mapped as a source folder in eclipse, just add the following line in the .classpath file of your project:

<classpathentry kind="src" path="src/main/resources"/>
aymeric
  • 3,877
  • 2
  • 28
  • 42