URLClassPath prioritize IDEA's testng-plugin resources dir over project resources
During implementation of some feature to the product one of my unit tests started working incorrectly because java couldn't find resource directory in the project. After spending some time debugging this issue I have found that path to this directory is loaded to the class path but during problem comes from URLClassPath.findResource
What happens is that when I run tests testng-plugin is loaded at the very start of the test and findResource method stops looking for the directory named "resources" when it finds that directory in testng-plugin.jar and completely ignores existence of that directory in the project path.
I have spent several hours trying to find workaround for this issue (except renaming "resources" directory and replacing directory name everywhere in the codebase) and I am at complete loss right now. What can I do to successfully load project's "resources" directory instead of testng-plugin one?
Please sign in to leave a comment.
Hello,
Please clarify what IntelliJ IDEA version do you use? Please share the little sample project where the issue is reproduced for you if possible, for this you may create an issue at YouTrack (https://youtrack.jetbrains.com) and attach the project to it in public mode or privately.