前言

在学习大数据Spark-Scala独立应用编程时,安装SBT下载依赖时出现如下错误:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.11 ...

:: problems summary ::
:::: WARNINGS
        problem while downloading module descriptor: https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml: 连接超时 (Connection timed out) (217508ms)

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

        ==== local: tried

          /home/swj/.ivy2/local/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

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

          /home/swj/.ivy2/local/org.scala-sbt/sbt/0.13.11/jars/sbt.jar

        ==== Maven Central: tried

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

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

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

        ==== typesafe-ivy-releases: tried

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

        ==== sbt-ivy-snapshots: tried

          https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

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

                ::          UNRESOLVED DEPENDENCIES         ::

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

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

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


:::: ERRORS
        Server access Error: 连接超时 (Connection timed out) url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.11: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/swj/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.11

具体问题就是:

Server access Error: 连接超时 (Connection timed out) url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/0.13.11/ivys/ivy.xml

下载依赖包,连接超时

问题原因

网站https证书出现问题,但可以通过http访问

解决方法

找到sbt-launch.jar, 用解压工具打开,更改里面sbt目录下sbt.boot.properties文件,把https协议改成http协议即可

[repositories]
  local
  maven-central
  typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
  sbt-ivy-snapshots: https://repo.scala-sbt.org/scalasbt/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly

如果还有问题,则再添加一条oschina镜像

[repositories]
  local
  maven-central
  oschina: http://maven.oschina.net/content/groups/public/
  typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
  sbt-ivy-snapshots: https://repo.scala-sbt.org/scalasbt/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
最后修改:2019 年 11 月 13 日 10 : 41 PM
可以请我喝瓶冰阔落~