{"id":347,"date":"2015-12-04T12:28:19","date_gmt":"2015-12-04T18:28:19","guid":{"rendered":"http:\/\/sha.nnoncarey.com\/blog\/?p=347"},"modified":"2016-03-04T17:42:21","modified_gmt":"2016-03-04T23:42:21","slug":"corrupted-scala-library-jar-causes-build-failure","status":"publish","type":"post","link":"https:\/\/sha.nnoncarey.com\/blog\/archives\/347","title":{"rendered":"Corrupted scala-library jar causes build failure"},"content":{"rendered":"<p>Had a heck of a time figuring out why, when I run &#8220;mvn compile&#8221; on my project that uses scalatest and scala-maven-plugin I always got:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;ERROR] java.lang.NoClassDefFoundError: scala\/Function1\r\n&#x5B;INFO] \tat java.lang.Class.getDeclaredMethods0(Native Method)\r\n&#x5B;INFO] \tat java.lang.Class.privateGetDeclaredMethods(Class.java:2701)\r\n&#x5B;INFO] \tat java.lang.Class.privateGetMethodRecursive(Class.java:3048)\r\n&#x5B;INFO] \tat java.lang.Class.getMethod0(Class.java:3018)\r\n&#x5B;INFO] \tat java.lang.Class.getMethod(Class.java:1784)\r\n&#x5B;INFO] \tat scala_maven_executions.MainHelper.runMain(MainHelper.java:155)\r\n&#x5B;INFO] \tat scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)\r\n<\/pre>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had a heck of a time figuring out why, when I run &#8220;mvn compile&#8221; on my project that uses scalatest and scala-maven-plugin I always got: &#x5B;ERROR] java.lang.NoClassDefFoundError: scala\/Function1 &#x5B;INFO] at java.lang.Class.getDeclaredMethods0(Native Method) &#x5B;INFO] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) &#x5B;INFO] at java.lang.Class.privateGetMethodRecursive(Class.java:3048) &#x5B;INFO] at java.lang.Class.getMethod0(Class.java:3018) &#x5B;INFO] at java.lang.Class.getMethod(Class.java:1784) &#x5B;INFO] at scala_maven_executions.MainHelper.runMain(MainHelper.java:155) &#x5B;INFO] at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26) The cause? A corrupted scala-library &hellip; <a href=\"https:\/\/sha.nnoncarey.com\/blog\/archives\/347\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Corrupted scala-library jar causes build failure&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-347","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":4,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}