服务器访问错误:连接超时url = https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

时间:2015-03-30 03:35:43

标签: sbt

我设置sbt时遇到了问题。我下载了一个" zip"并展开它,但是当我运行sbt命令时,发生了错误。

    module not found: org.scala-sbt#sbt;0.13.8

==== local: tried

  /home/zhang1/.ivy2/local/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

  -- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:

  /home/zhang1/.ivy2/local/org.scala-sbt/sbt/0.13.8/jars/sbt.jar

==== typesafe-ivy-releases: tried

  https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

==== Maven Central: tried

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom

  -- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar

    ::::::::::::::::::::::::::::::::::::::::::::::

    ::          UNRESOLVED DEPENDENCIES         ::

    ::::::::::::::::::::::::::::::::::::::::::::::

    :: org.scala-sbt#sbt;0.13.8: not found

    ::::::::::::::::::::::::::::::::::::::::::::::

::::错误     服务器访问错误:连接超时url = https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

Server access Error: Connection timed out url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom

Server access Error: Connection timed out url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,我通过

检查了http,https,ftp代理
env | grep "http_proxy" 

它返回正确的值,但这还不够。我在.bashrc文件中检查过,我仍面临同样的问题然后我打开sbt文件并添加JVM_OPT

-Dhttp.proxyHost=proxy.cnw.co.nz       
-Dhttp.proxyPort=8080   
-Dhttps.proxyHost=proxy.cnw.co.nz       
-Dhttps.proxyPort=8080 
-Dftp.proxyHost=proxy.cnw.co.nz       
-Dftp.proxyPort=8080 

借助此how-to-use-sbt-from-behind-proxy

最后点击java启动sbt

java $JVM_OPTS -jar $SBT_LAUNCHER $SBT_OPTS