导入sbt项目时出错,服务器访问错误,未解析的依赖项

时间:2016-01-08 22:09:26

标签: scala intellij-idea sbt

我正在尝试从IntelliJ IDE 15.0.2中的build.sbt中的项目中导入库。我一直得到未解决的依赖项错误。我尝试更新来自不同论坛的设置来解决它,但没有一个工作。我尝试过几件事:

  1. 使用代理设置更新sbtconfig.txt
  2. 清理并从项目设置中无效/重新启动缓存
  3. 删除.sbt,.ivy2文件夹并重新启动IDE并启动项目。仍然没有用。
  4. 以下是我现在遇到的错误:

    Nbr of module to sort : 0
        resolved ivy file produced in cache
    :: downloading artifacts ::
    :: resolution report :: resolve 185393ms :: artifacts dl 0ms
    WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
    WARN:   ::          UNRESOLVED DEPENDENCIES         ::
    WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
    WARN:   :: org.fusesource.jansi#jansi;1.11: not found
    WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
    
    Nbr of module to sort : 0
        report for org.scala-sbt#boot-jansi;1.0 default produced in C:\Users\admin\.sbt\boot\resolution-cache\org.scala-sbt-boot-jansi-default.xml
        resolve done (185393ms resolve - 0ms download)
    
    :: problems summary ::
    :::: WARNINGS
            module not found: org.fusesource.jansi#jansi;1.11
    
        ==== local: tried
    
          C:\Users\admin\.ivy2\local\org.fusesource.jansi\jansi\1.11\ivys\ivy.xml
    
          -- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:
    
    
        C:\Users\admin\.ivy2\local\org.fusesource.jansi\jansi\1.11\jars\jansi.jar
    
        ==== typesafe-ivy-releases: tried
    
          https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
    
        ==== Maven Central: tried
    
          https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
    
          -- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:
    
          https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar
    
            ::::::::::::::::::::::::::::::::::::::::::::::
    
            ::          UNRESOLVED DEPENDENCIES         ::
    
            ::::::::::::::::::::::::::::::::::::::::::::::
    
            :: org.fusesource.jansi#jansi;1.11: not found
    
            ::::::::::::::::::::::::::::::::::::::::::::::
    
    
    :::: ERRORS
        Server access Error: Connection reset url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
    
        Server access Error: Connection reset url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
    
        Server access Error: Connection reset url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar
    
    
    :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
    java.lang.RuntimeException: not found
        at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:238)
        at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:292)
        at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:714)
        at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:799)
        at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:722)
        at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:594)
        at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:234)
        at xsbt.boot.Update.xsbt$boot$Update$$lockedApply(Update.scala:106)
        at xsbt.boot.Update$$anon$4.call(Update.scala:100)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$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 xsbt.boot.Update.apply(Update.scala:101)
        at xsbt.boot.Launch.update(Launch.scala:352)
        at xsbt.boot.Launch$$anonfun$jansiLoader$1.apply(Launch.scala:178)
        at scala.Option.getOrElse(Option.scala:120)
        at xsbt.boot.Launch.jansiLoader$2f324eef(Launch.scala:173)
        at xsbt.boot.Launch.<init>(Launch.scala:150)
        at xsbt.boot.Launcher$.apply(Launch.scala:366)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
    Error during sbt execution: Error retrieving required libraries
        at xsbt.boot.Pre$.error(Pre.scala:26)
        at xsbt.boot.Update.xsbt$boot$Update$$lockedApply(Update.scala:106)
        at xsbt.boot.Update$$anon$4.call(Update.scala:100)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$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 xsbt.boot.Update.apply(Update.scala:101)
        at xsbt.boot.Launch.update(Launch.scala:352)
        at xsbt.boot.Launch$$anonfun$jansiLoader$1.apply(Launch.scala:178)
        at scala.Option.getOrElse(Option.scala:120)
        at xsbt.boot.Launch.jansiLoader$2f324eef(Launch.scala:173)
        at xsbt.boot.Launch.<init>(Launch.scala:150)
        at xsbt.boot.Launcher$.apply(Launch.scala:366)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
    Error during sbt execution: Error retrieving required libraries
    

2 个答案:

答案 0 :(得分:2)

找到了解决此问题的方法..这是我的机器尝试通过ipv6 TCP / IP堆栈连接到ipv4 Internet IP。我确实运行了这个命令来应用修复程序强制并使用ipv4

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

答案 1 :(得分:0)

我尝试在没有互联网的机器上导入项目(导入build.sbt文件)。

我收到了类似的错误消息:

UNRESOLVED DEPENDENCIES
org.fusesource.jansi#jansi;1.11: not found

在IntelliJIdea窗口中没有任何堆栈跟踪。

然后我在repositories文件夹中创建了文件[home_dir]/.sbt/,并为我提供了正确的存储库列表,并且它有效。

请参阅http://www.scala-sbt.org/0.13/docs/Proxy-Repositories.html