I’ve got a problem with my eclipse classpath with the m2e plugin.
I have a project which depends on other projects in my workspace. I’ve added these dependencies as maven dependencies with scope provided. I expect the scope to do the following:
Provide the dependencies for compilation but exclude them for the runtime classpath.
Because at runtime, these classes should be loaded from jars inside a folder.
But the eclipse classpath includes every single dependency I’ve provided in the project pom.
Eclipse seems to ignore the provided scope.
Is there any way to exclude those from runtime classpath?
Regards
m2e is doing its job properly here. I think you misunderstand the meaning of ‘runtime’. Your project does in fact depend on the other projects at both compile and runtime and when you build it with Maven, the POM will reflect that. You would only use scope ‘provided’ if you were planning to deploy the project to e.g. an application server that provides the dependencies itself.