I created a simple Maven project with Eclipse (Oxygen.2 Release (4.7.2)) with the standard src/main/resources folder and added it to the classpath. The problem is that Eclipse adds an exclusion pattern of **
to the src/main/resources folder. Here are some pics to better explicate the situation:
You can reproduce the situation yourself, just remember to run Maven -> Update project...
According to this answer this is not a bug but it's the correct behaviour.
So the question is: how do i read a resource file from src/main/resources?
I can't use the explicit path src/main/resources since there will be no such path in the compiled results and I can't use .getResource or .getResourceAsStream since Eclipse put an exclusion pattern of **
on that path.