Corrupted scala-library jar causes build failure

Had a heck of a time figuring out why, when I run “mvn compile” on my project that uses scalatest and scala-maven-plugin I always got:

[ERROR] java.lang.NoClassDefFoundError: scala/Function1
[INFO] 	at java.lang.Class.getDeclaredMethods0(Native Method)
[INFO] 	at java.lang.Class.privateGetDeclaredMethods(
[INFO] 	at java.lang.Class.privateGetMethodRecursive(
[INFO] 	at java.lang.Class.getMethod0(
[INFO] 	at java.lang.Class.getMethod(
[INFO] 	at scala_maven_executions.MainHelper.runMain(
[INFO] 	at scala_maven_executions.MainWithArgsInFile.main(

The cause? A corrupted scala-library JAR in the local Maven repository. Once I deleted it and allowed Maven to re-download it, everything started working.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.