Affects Version/s: 2.0.2
Fix Version/s: None
Number of attachments :
When executing compiler:testCompile, all runtime dependencies are added to the classpath to compile the test source code. This is contrary to the purpose of the runtime scope, which is simply to include the dependency when running the code, not compiling.
Here is what Maven's website says about the runtime scope:
"this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath."
...And here is what Better Builds with Maven says about the runtime scope:
"This is because, in this situation, the (runtime) dependency is used only for packaging, not for compilation. In fact, if the dependency were required for compilation, for stability it would always be declared in the current POM as a dependency - regardless of whether another dependency introduces it." - page 65
"Check that the scope of your dependencies are set correctly (to test if only used for unit tests, or runtime if it is needed to bundle with or run the application but not for compiling your source code)." - page 204