Scala SBT / Maven2 Error on OSX: "Error Opening Zip File" -> MissingRequirementError

ivy, maven, maven-2, sbt, scala

Solution

I had similar problems when attempting to use an older version of the sbt-extras launcher with sbt-0.11.3. In my case, it attempted to download a file that didn't exist, and attempted to unzip the 404 error page. The most recent sbt-extras launcher has been fixed for sbt-0.11.3.

Yours sounds different, but they may be due to the the shutdown of scala-tools.org. If you can, I recommend upgrading to sbt-0.11.3.

If you need to continue to use 0.11.2, you should use the 0.11.3-2 launcher, put `sbt.version=0.11.2` in `project/build.properties`, and disable the `scalaTools` repo in your `build.sbt`. Mark Harrah posted info on the SBT mailing list.

If this doesn't help, for some reason you're downloading corrupted `.jar`s from somewhere.

Run the command `find ~/.ivy2 ~/.m2 ~/.sbt -name "*.jar" -exec unzip -qqt {} \;` to find which jar(s) are corrupted. The contents of the corrupt jar may give you a clue as to what's going wrong.

Problem

I have a project that builds well on Unix boxes (http://www.github.com/jhclark/ducttape). However, using SBT 0.11.2 (and a few other versions of SBT), it will not build on my Mac (OSX 10.5). I get the following cryptic error message: ``` $ ~/bin/sbt compile (master*? 20:11) [info] Loading project definition from /Users/jon/Documents/workspace- scala/ducttape/project [info] Set current project to ducttape (in build file:/Users/jon/Documents/workspace-scala/ducttape/) [info] Compiling 104 Scala sources to /Users/jon/Documents/workspace-scala/ducttape/target/scala-2.9.2/classes... [error] error while loading <root>, error in opening zip file [error] {file:/Users/jon/Documents/workspace-scala/ducttape/}default-024416/compile:compile: scala.tools.nsc.MissingRequirementError: object scala not found. [error] Total time: 2 s, completed May 27, 2012 8:12:09 PM ``` This happens even after I clean things out thoroughly with: ``` sbt clean clean-files rm -rf ~/.ivy2 ~/.m2 ~/.sbt ``` I suspect that the real error is happening in Maven2, which SBT uses for dependency management (see also Maven : error in opening zip file when running maven). However, I'm stumped after several days. Any ideas?

Original source

Related problems