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

Deadly 提交于 2019-12-07 01:24:21

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/5137584/maven-eclipse-the-default-build-path-for-resources-excluded-everything

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!