You seem to be doing this right, though I'm not familiar exactly with the Maven plugin which you seem to be using.
Thing is, when scoverage excludes files, it still compiles the classes in them, but it doesn't instrument them, resulting in a .class
file identical to one which will be produced by compilation without the plugin. This might be confusing you to see .class
files for classes originated in source files you explicitly excluded -- it sure did confuse me -- but this is how the plugin works.
Update:
The Scoverage scalac plugin will try to match file paths to the regex after removing .scala
from them; i.e, omit the .scala
from your regex as it will never match any file pattern.
Also note that the regex is matched against paths and not class names; i.e, use /
instead of \.
. Can't say if this works on Windows (if not then it's a bug with the scalac plugin).