sbt throws [error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/

huangapple go评论79阅读模式
英文:

sbt throws [error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/

问题

  • 我清理了我的 ~/.ivy2/cache 目录。
  • 我的 project/plugins.sbt 文件:
$ cat project/plugins.sbt
// 注释以在初始化期间获取更多信息
logLevel := Level.Warn
// Typesafe 仓库
resolvers += "Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository"
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"
// 为 Play 项目使用 Play sbt 插件
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.10")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2")
  • 我的 ~/.sbt/repositories 文件:
$ cat ~/.sbt/repositories
[repositories]
  local
  activator-launcher-local: file://${activator.local.repository-${activator.home-${user.home}/.activator}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  activator-local: file://${activator.local.repository-/Users/debodirno/activator-dist-1.3.12/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-releases-repo: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central: https://repo1.maven.org/maven2/
  typesafe-releases: https://repo.typesafe.com/typesafe/releases
  typesafe-ivy-releasez: https://repo.typesafe.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

我正在运行 activator clean

$ activator clean
[info] 从 /Users/debodirno/personal/src/sitesearch/project 加载项目定义
[error] 服务器访问错误:连接被拒绝 (连接被拒绝) url=http://repo.typesafe.com/typesafe/ivy-releases/org.iq80.leveldb/leveldb/0.5/ivys/ivy.xml
[error] 服务器访问错误:连接被拒绝 (连接被拒绝) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.iq80.leveldb/leveldb/0.5/ivys/ivy.xml
[error] 服务器访问错误:连接被拒绝 (连接被拒绝) url=http://repo.typesafe.com/typesafe/ivy-releases/org.iq80.leveldb/leveldb-api/0.5/ivys/ivy.xml
[error] 服务器访问错误:连接被拒绝 (连接被拒绝) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.iq80.leveldb/leveldb-api/0.5/ivys/ivy.xml
[error] 服务器访问错误:连接被拒绝 (连接被拒绝) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-all/1.7/ivys/ivy.xml
...
...
...

基本上,我想知道它是从哪里获取了 http://repo.typesafe.com/typesafe/ivy-releases/
另外,我没有更改项目的配置,为什么突然失败了。

英文:
  • I cleaned my ~/.ivy2/cache directory.
  • My project/plugins.sbt file :
$ cat project/plugins.sbt
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository"
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.10")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2")
  • My My ~/.sbt/repositories file :
$ cat ~/.sbt/repositories
[repositories]
  local
  activator-launcher-local: file://${activator.local.repository-${activator.home-${user.home}/.activator}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  activator-local: file://${activator.local.repository-/Users/debodirno/activator-dist-1.3.12/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-releases-repo: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central: https://repo1.maven.org/maven2/
  typesafe-releases: https://repo.typesafe.com/typesafe/releases
  typesafe-ivy-releasez: https://repo.typesafe.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

I am running activator clean:

$ activator clean
[info] Loading project definition from /Users/debodirno/personal/src/sitesearch/project
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.iq80.leveldb/leveldb/0.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.iq80.leveldb/leveldb/0.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.iq80.leveldb/leveldb-api/0.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.iq80.leveldb/leveldb-api/0.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-all/1.7/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.leveldbjni/leveldbjni-all/1.7/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni/1.7/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.leveldbjni/leveldbjni/1.7/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.hawtjni/hawtjni-runtime/1.8/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.hawtjni/hawtjni-runtime/1.8/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-osx/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.leveldbjni/leveldbjni-osx/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-linux32/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.leveldbjni/leveldbjni-linux32/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-linux64/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.fusesource.leveldbjni/leveldbjni-linux64/1.5/ivys/ivy.xml
[error] Server access Error: Connection refused (Connection refused) url=http://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.leveldbjni/leveldbjni-win32/1.5/ivys/ivy.xml
...
...
...

Basically, I want to know from where is it getting the http://repo.typesafe.com/typesafe/ivy-releases/
Also, I have not changed configurations of my project, so why is this failing suddenly.

答案1

得分: 14

能够在向 build.sbt 添加额外的类型安全的 https 解析器后解决。默认情况下,sbt 会选择使用 http 解析器。如果你已经配置了解析器(就像我配置了 maven 一样),新的一行是重要的,否则你可以使用 Seq 构造)

resolvers += "Maven Central Server" at "https://repo1.maven.org/maven2"
resolvers += "Typesafe Server" at "https://repo.typesafe.com/typesafe/releases"
英文:

Able to resolve after adding additional type safe https resolver to the build.sbt. By default sbt was picking the http one. If you already have resolver configured (like I have maven) the new line is important or else you can use Seq construct)

resolvers += "Maven Central Server" at "https://repo1.maven.org/maven2"

resolvers += "Typesafe Server" at "https://repo.typesafe.com/typesafe/releases"

答案2

得分: 5

我已将解析器设置为"http://repo.typesafe.com/typesafe/releases/",将解析器更改为使用https使其正常工作。

英文:

I had my resolvers set to "http://repo.typesafe.com/typesafe/releases/" and changing the resolver to using https made it work.

答案3

得分: 0

在下面链接中提到的情况下,需要升级sbt.version

build.properties文件中:

sbt.version=0.13.18

链接:https://github.com/sbt/sbt/issues/6200

英文:

Need to upgrade the sbt.version as mentioned in the link below, if the issue still persists

In build.properties file

sbt.version=0.13.18

https://github.com/sbt/sbt/issues/6200

huangapple
  • 本文由 发表于 2020年8月21日 10:06:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/63515509.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定