Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven/Eclipse: The default build path for resources excluded everything

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.

like image 572
Xiè Jìléi Avatar asked Feb 28 '11 02:02

Xiè Jìléi


People also ask

What is Eclipse build path?

Build path is used by the compiler to resolve dependencies and build a project. Classpath is used during runtime when running a project in order to find necessary dependencies. Build path is configured on the Java Build Path property page of a project.


1 Answers

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.

like image 117
bmargulies Avatar answered Sep 20 '22 14:09

bmargulies