为什么SBT解决SNAPSHOT版本?

时间:2017-10-16 15:49:09

标签: sbt nexus ivy

以下是我的解析器:

resolvers in ThisBuild ++= Seq(
  "Sonatype Nexus Repository Manager" at "https://.../repository/maven-snapshots/",
  "Sonatype Nexus Repository Manager" at "https://.../repository/maven-releases/")

以下是指定依赖关系的方式:

libraryDependencies += a %% b % "1.+"

Nexus在1.0.0

中包含maven-releases

这是我得到的日志:

[FAILED     ] a#b_2.11;1.0.0-SNAPSHOT!b_2.11.jar:  (0ms)
[warn] ==== local: tried
[warn]   /Users/me/.ivy2/local/a/b_2.11/1.0.0-SNAPSHOT/jars/b_2.11.jar
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/.../b_2.11/1.0.0-SNAPSHOT/b_2.11-1.0.0-SNAPSHOT.jar
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/me/.sbt/preloaded/a/b_2.11/1.0.0-SNAPSHOT/jars/b_2.11.jar
[warn] ==== local-preloaded: tried
[warn]   file:////Users/pavelvoronin/.sbt/preloaded/.../b_2.11/1.0.0-SNAPSHOT/b_2.11-1.0.0-SNAPSHOT.jar
[warn] ==== Sonatype Nexus Repository Manager: tried
[warn]   https://.../repository/maven-snapshots/.../b_2.11/1.0.0-SNAPSHOT/b_2.11-1.0.0-SNAPSHOT.jar
[warn] ==== Sonatype Nexus Repository Manager: tried
[warn]   https://.../repository/maven-releases/.../b_2.11/1.0.0-SNAPSHOT/b_2.11-1.0.0-SNAPSHOT.jar

为什么要查找SNAPSHOT?而且没有注意到1.0.0

来自Ivy docs的一些行:

  

+ 结束修订,选择最新的子修订版   依赖模块。例如,如果依赖模块存在于   修订版1.0.3,1.0.7和1.1.2," 1.0。+"将选择1.0.7。


更新

在我清理了常春藤缓存后,它开始告诉我找不到1.+。以下是来自Nexus的一些日志:

2017-10-18 11:51:07,030+0000 DEBUG [qtp219355933-2530] user org.sonatype.nexus.repository.view.Router - Request: Request{action=‘HEAD’, path=‘/.../b_2.11/maven-metadata.xml’, parameters={}, payload=HttpRequestPayloadAdapter{contentType=‘null’, size=-1}, multipart=false}

2017-10-18 11:51:07,031+0000 DEBUG [qtp219355933-2530] user org.sonatype.nexus.repository.view.handlers.BrowseUnsupportedHandler$MatcherImpl - Matching: HEAD /.../b_2.11/maven-metadata.xml

2017-10-18 11:51:07,034+0000 DEBUG [qtp219355933-2530] user org.sonatype.nexus.repository.view.Router - Response: Response{status=Status{successful=false, code=404, message=‘.../b_2.11/maven-metadata.xml’}, payload=null}

1 个答案:

答案 0 :(得分:0)

问题在于标准sbt pack不会创建maven-metadata.xml文件。

使用Aether-deploy插件,一切正常。