I am using sbt-scoverage plugin for a project written in Play Framework.
I'm facing the following java.lang.RuntimeException: Duplicate mappings error:
[scoverage]: Instrumentation completed [35097 statements]
[scoverage]: Written instrumentation file [/Users/project/target/scala-2.10/scoverage-data/scoverage.coverage.xml]
[scoverage]: Writing measurements data to [/Users/project/target/scala-2.10/scoverage-data]
...
[info] Compiling 49 Scala sources to /Users/project/target/scala-2.10/test-classes...
java.lang.RuntimeException: Duplicate mappings:
/Users/project/target/scala-2.10/scoverage-classes/services-main.js
from
/Users/project/target/scala-2.10/resource_managed/main/public/javascripts/global/services/services-main.js
/Users/project/target/scala-2.10/resource_managed/main/public/javascripts/kiosk/global/services/services-main.js
/Users/project/target/scala-2.10/scoverage-classes/global.min.css
from......
My guess is that it's trying to transfer service-main.js from somewhere in the target under scoverage-classes. I do not intend to run scoverage against any JavaScript file so I included the following setting:
ScoverageKeys.excludedPackages in ScoverageCompile := ".views.;.javascripts.;.assets.;.js.;.resource_managed."
It changes nothing - the error persists. How do I instruct scoverage to ignore JavaScript files?
It's just a guess, but worth pursuing to check if it fixes the issue.
According to Exclude classes and packages:
I think the regular expressions you use are incorrect and since they don't match they are of no effect. Use
.*not.as follows: