2

Tests run without any problem in sbt, but when you need them in IntelliJ, they fail.

A needed class was not found. This could be due to an error in your runpath.
Missing class: scoverage/Invoker$
java.lang.NoClassDefFoundError: scoverage/Invoker$

I have seen many suggesting during the years how to fix it, but nothing really helped. :)

Donald Duck
  • 476
  • 3
  • 12

2 Answers2

2

Just perform a rebuild (Build -> Rebuild Project).

Intellij is probably storing some temporary/cached files and rebuilding clears them.

pedromorfeu
  • 1,739
  • 14
  • 18
1

Finally discovered a solution, which worked for me:

Temporarely disable scoverage plugin for sbt project(s) in questions

lazy val pipeline: Project = project
...
  .disablePlugins(ScoverageSbtPlugin) // <-- temp

Bonus: tests are running faster as well.

Donald Duck
  • 476
  • 3
  • 12