Why resource folders in Java project have excluded="**"
Many users are confused that when Java project is configured in Eclipse, resource folders gets excluded="**". This is done intentionally, because those resources are processed by the "Maven Builder" registered to the project. This builder provides special resource handling, that includes filtering, as well as execution of other Maven plugins for processing resources. See Maven build lifecycle for more details.
If you manually remove resource exclusion, JDT will copy resources and overwrite filtered resources generated by Maven plugins.
Actually project resource folder doesn't really need to be added to the buildpath (Maven Builder is going to work without it), but it been considered convenient and look better in the Package Explorer and other Eclipse views.
Also note, that classpath used for JUnit and Java Application launch configurations for projects that have Maven support enabled is also calculated in a special way and excluded resources does not affect it either.
本文解释了为什么在Eclipse中配置Java项目时,资源文件会被设置为排除所有内容(excluded=**)。这是为了确保这些资源由Maven Builder进行处理,包括过滤和其他插件的处理。手动移除排除设置会导致JDT复制资源并覆盖由Maven插件生成的已过滤资源。
1856

被折叠的 条评论
为什么被折叠?



