Assume that we have scala maven projects A and B. Project B has project A as a compile dependency. The goal is to test project B solely.
I have chosen to copy project A, making a mock-module A1, which has the same packages and API, but returns only valid objects without any logical processing.
Mock-project A1 is added to B's pom as a dependency for test scope.
I've managed to replace project A with mock-project A1 using this configuration for maven-surefire-plugin:
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>AProjectGroupId:AProjectArtifactId</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>
But I can't seem to find such configuration abilities for scalatest-maven-plugin.
So, how do I exclude dependency from classpath for tests in scalatest plugin? I'm guessing it also can be done in scala-maven-plugin for testCompile goal, but I still can't find how to configure it.