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?
This bug was fixed in release 1.0.0. Note that the config changed so be sure to check the readme (most notably, the command to run changed from
sbt scoverage:testtosbt coverage testand the plugin became an auto plugin so you don't need to add instrumentSettings anymore).https://github.com/scoverage/sbt-scoverage