Does it work in Maven via the command line? The behavior seems right. Eclipse is used to handle the class path poorly, so I think it still does.
There is a difference if you run something in Test source root or Source root , since the scope provided is available only in the compilation class and test .
If you run the test or the main method in Test source root , then it can use the provided dependencies, but if you try to execute something (via IntelliJ or exec-maven-plugin ) in the Source root , then it will fail on a ClassNotFoundException.
source share