sbt无法下载jna-4.1.0.jar连接重置

时间:2016-06-06 13:25:06

标签: scala sbt playframework-2.5

我有一个新的SBT / Scala设置和现有的Play / Scala项目。当我尝试在文件夹中运行id: value.id时,我收到以下错误:

activator clean

如果我尝试在浏览器中粘贴jar的URL [info] Resolving org.fusesource.jansi#jansi;1.4 ... [info] downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna -4.1.0.jar ... [warn] [FAILED ] net.java.dev.jna#jna;4.1.0!jna.jar: Connection reset (1178 4ms) [warn] [FAILED ] net.java.dev.jna#jna;4.1.0!jna.jar: (0ms) [warn] ==== typesafe-ivy-releases: tried [warn] https://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/4. 1.0/jars/jna.jar [warn] ==== sbt-plugin-releases: tried [warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/net.java.dev.jn a/jna/4.1.0/jars/jna.jar [warn] ==== local: tried [warn] C:\Users\xxxxxxxxxxxx\.ivy2\local\net.java.dev.jna\jna\4.1.0\jars\jna. jar [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar [warn] ==== activator-launcher-local: tried [warn] C:\Projects\xxxxxxxxxxxx\repository\net.java.dev.j na\jna\4.1.0\jars\jna.jar [warn] ==== typesafe-releases: tried [warn] https://repo.typesafe.com/typesafe/releases/net/java/dev/jna/jna/4.1.0/ jna-4.1.0.jar [warn] ==== typesafe-ivy-releasez: tried [warn] https://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/4. 1.0/jars/jna.jar [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: FAILED DOWNLOADS :: [warn] :: ^ see resolution messages for details ^ :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: net.java.dev.jna#jna;4.1.0!jna.jar [warn] :::::::::::::::::::::::::::::::::::::::::::::: sbt.ResolveException: download failed: net.java.dev.jna#jna;4.1.0!jna.jar at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313) at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191) at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168) at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156) at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156) at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133) at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57) at sbt.IvySbt$$anon$4.call(Ivy.scala:65) at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93) at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRet ries$1(Locks.scala:78) at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala: 97) at xsbt.boot.Using$.withResource(Using.scala:10) at xsbt.boot.Using$.apply(Using.scala:9) at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58) at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48) at xsbt.boot.Locks$.apply0(Locks.scala:31) at xsbt.boot.Locks$.apply(Locks.scala:28) at sbt.IvySbt.withDefaultLogger(Ivy.scala:65) at sbt.IvySbt.withIvy(Ivy.scala:128) at sbt.IvySbt.withIvy(Ivy.scala:125) at sbt.IvySbt$Module.withModule(Ivy.scala:156) at sbt.IvyActions$.updateEither(IvyActions.scala:168) at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala :1439) at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala :1435) at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1 470) at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1 468) at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37) at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1473) at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1467) at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60) at sbt.Classpaths$.cachedUpdate(Defaults.scala:1490) at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1417) at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1369) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:22 8) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:22 8) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestric tions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51 1) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:617) at java.lang.Thread.run(Thread.java:745) [error] (*:update) sbt.ResolveException: download failed: net.java.dev.jna#jna;4 .1.0!jna.jar Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? ,我就可以下载jar了。 我试图删除.sbt和.ivy文件夹,然后再次运行命令,但得到了同样的错误。

不确定发生了什么?

提前致谢。

更新 我从激活器UI运行构建并启用了调试输出。这是我发现的:

Activator首先尝试下载https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar

真的不存在。将URL复制并粘贴到浏览器中,表示找不到。

然后尝试https://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/4.1.0/jars/jna.jar并因同样的原因失败。

然后尝试https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/net.java.dev.jna/jna/4.1.0/jars/jna.jar成功并开始下载,但失败并出现以下错误:

https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar

不确定是什么导致[info] downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar ... downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar ... public: downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar [warn] [FAILED ] net.java.dev.jna#jna;4.1.0!jna.jar: Connection reset (22821ms) [FAILED ] net.java.dev.jna#jna;4.1.0!jna.jar: Connection reset (22821ms) tried http://repo.typesafe.com/typesafe/releases/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/releases/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar tried http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/4.1.0/jars/jna.jar CLIENT ERROR: Not Found url=http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/4.1.0/jars/jna.jar

更新2:事实证明,有问题的jar中有一个DLL文件。我想知道是否是导致问题的Netscaler / Antivirus。与网络管理员录制了一个电话。

1 个答案:

答案 0 :(得分:0)

我可以获得您没有将Local Maven Repository设置为您的存储库之一的信息,这意味着您的sbt项目将不会搜索本地maven存储库中的依赖项,该存储库是存储您的maven依赖项jar的地方。如果您的sbt项目无法从互联网上下载jar。您可以通过执行以下操作来提供帮助:

首先,在build.sbt中添加以下语句

resolvers += ("Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository")

其次,自己从maven存储库下载依赖jar。至于您的问题,下载链接为there

然后,假设jar文件位于目录~

中,使用以下命令将jar发布到本地maven存储库
mvn install:install-file -Dfile=~/jna-4.1.0.jar -DgroupId=net.java.dev.jna -DartifactId=jna -Dversion=4.1.0 -Dpackaging=jar

最后,刷新你的sbt项目。

如果找到mvn command not found,请安装它。

我给另一个问题回答的reference可能对你有帮助。

祝你好运