【问题标题】:Why can’t SBT resolve SecureSocial-snapshot dependency?为什么 SBT 不能解决 SecureSocial-snapshot 依赖?
【发布时间】:2015-07-18 01:38:21
【问题描述】:

我想在我的项目中使用这个 SecureSocial 快照:

https://oss.sonatype.org/content/repositories/snapshots/ws/securesocial/securesocial_2.11/master-SNAPSHOT/

但是 SBT 无法解决它。这是错误消息:

[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/ws.securesocial/securesocial_2.11/master-SNAPSHOT/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   https://repo.typesafe.com/typesafe/releases/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[info] Resolving jline#jline;2.12 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: ws.securesocial#securesocial_2.11;master-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

这是我的解析器和库依赖项:

构建.scala:

libraryDependencies ++= Seq(
  "org.webjars" %% "webjars-play" % "2.3.0-3",
  "org.logback-extensions" % "logback-ext-loggly" % "0.1.2",
  "ws.securesocial" % "securesocial_2.11" % "master-SNAPSHOT"
)

plugins.sbt:

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

resolvers += "Sonatype OSS Releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

据我所知,这应该有效,但它没有。这个问题的原因是什么?

版本信息:

  • Scala 版本:2.11.5
  • SBT 版本:0.13.8
  • 播放版本:2.3.7

【问题讨论】:

    标签: scala sbt


    【解决方案1】:

    您为库添加的解析器应该放在build.sbt 中,而不是plugins.sbt 中。这两个文件没有级联,如果您看到 sbt 的输出,它甚至没有尝试连接到 Sonatype。在build.sbt 中移动这一行,它应该可以工作:

    resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
    

    值得注意的是,只有当您想要包含不在默认存储库中的 sbt 插件时,您才需要在 plugins.sbt 中添加解析器。

    【讨论】:

      猜你喜欢
      • 2011-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-08
      • 2018-03-28
      • 2016-06-19
      • 2014-12-18
      • 2016-01-22
      相关资源
      最近更新 更多