8

I'm using M2E for maven integration with eclipse. My unit tests reference property files in the resources/ directory. Well, everything fine in the command line test (mvn test). However, in Eclipse, the resources couldn't be found.

Check the Java Build Path, there, all resources entries are marked with Excluded: **. (I deem it should only exclude .java/.class files) Then, after removed the exclude pattern, the problem fixed.

I'm not sure whether I should remove all Excluded ** by hand, or maybe I doesn't use M2E correctly.

P.S. The projects are imported by Existing Maven Projects.

Lenik
  • 13,946
  • 17
  • 75
  • 103

1 Answers1

6

It does this on purpose, to allow the maven-resource-plugin to do the resource copying. You might have filters enabled after all. I have pestered the m2e list about this, you are welcome to file a bugzilla and join in the pestering. it is really annoying.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • Thanks, I've also found that `Update project configuration` doesn't generate filtered resource, anyway. How can I join in the pestering? I didn't get it. – Lenik Mar 07 '11 at 11:03
  • 1
    "Maven Integration for Eclipse users mailing list" , – bmargulies Mar 07 '11 at 12:31
  • It's confirmed as a bug, and was fixed since 0.12.x. – Lenik May 06 '11 at 06:15
  • 1
    @XièJìléi It's still not fixed as of Maven 3.6.3, using embedded Maven on Eclipse IDE 2020-06. It just keeps automatically adding and excluding everything with `**` in the Java build path. – tom_mai78101 Aug 06 '20 at 21:06
  • 1
    And here I am in 2022 still seeing the same problem. Is there any work around for this? – Brett Sutton Jul 05 '22 at 08:41