为什么SBT要解析SNAPSHOT版本?
Why does SBT resolve SNAPSHOT version?
这是我的解析器:
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 在 maven-releases
中包含 1.0.0
这是我得到的日志:
[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
?
常春藤的一些台词docs:
end the revision with a + selects the latest sub-revision of the
dependency module. For instance, if the dependency module exists in
revision 1.0.3, 1.0.7 and 1.1.2, "1.0.+" will select 1.0.7.
更新
清理 Ivy 缓存后,它开始告诉我找不到 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}
问题是标准 sbt pack
不会创建 maven-metadata.xml
文件。
使用 Aether-deploy 插件一切正常。
这是我的解析器:
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 在 maven-releases
1.0.0
这是我得到的日志:
[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
?
常春藤的一些台词docs:
end the revision with a + selects the latest sub-revision of the dependency module. For instance, if the dependency module exists in revision 1.0.3, 1.0.7 and 1.1.2, "1.0.+" will select 1.0.7.
更新
清理 Ivy 缓存后,它开始告诉我找不到 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}
问题是标准 sbt pack
不会创建 maven-metadata.xml
文件。
使用 Aether-deploy 插件一切正常。