我有一个SBT项目,其中包含以下解析器定义:
resolvers += Resolver.mavenLocal
resolvers += Resolver.url("my-release", url("https://myrepo.net/artifactory/libs-release"))
resolvers += Resolver.url("my-snapshot", url("https://myrepo.net/artifactory/libs-snapshot-local"))
(我改变了我公司的回购网址)。
SBT 0.13.9能够从指定的存储库(包括maven local)解析我公司的工件,但是当我尝试升级到1.1.2时,它似乎只解析已下载的工件到本地常春藤缓存。找不到新的工件。这是运行sbt update
命令的输出的一部分:
[warn] module not found: com.mycompany.artifact#my-artifact;1.2.3
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Maven2 Local: tried
[warn] ==== my-release: tried
[warn] ==== my-snapshot: tried
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.mycompany.artifact#my-artifact;1.2.3: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
所以它似乎检查了我的回购,但仍未找到工件。
我可以做的解决方法是回滚到SBT 0.13,至少构建一个项目一次(0.13将缺少的工件添加到常春藤缓存中),然后将版本更改回1.1.2。
更新:对于maven存储库,您需要使用at
而不是Resolver.url
:
resolvers += "my-release" at "https://myrepo.net/artifactory/libs-release"
resolvers += "my-snapshot" at "https://myrepo.net/artifactory/libs-snapshot-local"
这种方式可以正常使用。
答案 0 :(得分:0)
看来,对于Maven存储库,您需要使用at
而不是Resolver.url
:
resolvers += "my-release" at "https://myrepo.net/artifactory/libs-release"
resolvers += "my-snapshot" at "https://myrepo.net/artifactory/libs-snapshot-local"
这样可以正常工作。