问题描述
我使用M2E与eclipse进行maven集成。我的单元测试资源/目录中的引用属性文件。那么在命令行测试( mvn test
)中的一切都很好。但是,在Eclipse中,无法找到资源。 检查Java Build Path,所有资源条目都标有排除:**
。 (我认为它应该只排除 .java / .class文件)然后,删除排除模式后,修复了问题。
我不知道我是否应该手动删除所有排除的**
,否则我不会正确使用M2E。
项目由现有的Maven项目
导入。
这是有意义的,允许maven资源插件进行资源复制。您可能已经启用了过滤器。我已经打扰了这个m2e的列表,欢迎你提交一个bugzilla并加入到这个消息中。真的很讨厌。
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
.
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.
这篇关于Maven / Eclipse:资源的默认构建路径排除了所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!