diff --git a/bootstrap/src/main/java/coursier/Bootstrap.java b/bootstrap/src/main/java/coursier/Bootstrap.java index 8222ea293..4c1035d38 100644 --- a/bootstrap/src/main/java/coursier/Bootstrap.java +++ b/bootstrap/src/main/java/coursier/Bootstrap.java @@ -74,7 +74,7 @@ public class Bootstrap { for (int i = offset + 2; i < args.length; i++) remainingArgs.add(args[i]); - File jarDir = new File(jarDir0); + final File jarDir = new File(jarDir0); if (jarDir.exists()) { if (!jarDir.isDirectory()) @@ -123,26 +123,28 @@ public class Bootstrap { for (URL url : urls) { if (!url.getProtocol().equals("file")) { + final URL url0 = url; + completionService.submit(new Callable() { @Override public URL call() throws Exception { - String path = url.getPath(); + String path = url0.getPath(); int idx = path.lastIndexOf('/'); // FIXME Add other components in path to prevent conflicts? String fileName = path.substring(idx + 1); File dest = new File(jarDir, fileName); if (!dest.exists()) { - System.err.println("Downloading " + url); + System.err.println("Downloading " + url0); try { - URLConnection conn = url.openConnection(); + URLConnection conn = url0.openConnection(); long lastModified = conn.getLastModified(); InputStream s = conn.getInputStream(); byte[] b = readFullySync(s); Files.write(dest.toPath(), b); dest.setLastModified(lastModified); } catch (Exception e) { - System.err.println("Error while downloading " + url + ": " + e.getMessage() + ", ignoring it"); + System.err.println("Error while downloading " + url0 + ": " + e.getMessage() + ", ignoring it"); throw e; } } diff --git a/build.sbt b/build.sbt index fe825db36..42f5c9f3f 100644 --- a/build.sbt +++ b/build.sbt @@ -46,6 +46,11 @@ lazy val baseCommonSettings = Seq( "Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases", Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots") + ), + scalacOptions += "-target:jvm-1.7", + javacOptions ++= Seq( + "-source", "1.7", + "-target", "1.7" ) ) @@ -173,7 +178,8 @@ lazy val bootstrap = project artifactName0(sv, m, artifact) }, crossPaths := false, - autoScalaLibrary := false + autoScalaLibrary := false, + javacOptions in doc := Seq() ) lazy val `coursier` = project.in(file(".")) diff --git a/coursier b/coursier index c73f9338e..5d8afc47d 100755 Binary files a/coursier and b/coursier differ