oss.sonatype.org的SBT解析器不起作用 [英] SBT resolver for oss.sonatype.org not working

查看:106
本文介绍了oss.sonatype.org的SBT解析器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了问题(可能与build.sbt文件的错误配置有关),但是在过去的15分钟里,我一直无法弄清楚是什么。

I have a problem (likely related to a bad configuration of my build.sbt file) but for the last 15 minutes I've been unable to figure out what.

我有以下build.sbt:

I have the following build.sbt:

scalaVersion := "2.12.1"

version := "0.1"

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

libraryDependencies += "io.plasmap" %% "geow" % "0.3.11-SNAPSHOT"

由于某些原因,当我尝试运行 sbt update (或编译或运行)时,出现以下错误:

For some reason when I try to run sbt update (or compile or run) I get an error along the lines of:


sbt.ResolveException:未解决的依赖项:
io.plasmap#geow_2.12; 0.3.11-SNAPSHOT:找不到

sbt.ResolveException: unresolved dependency: io.plasmap#geow_2.12;0.3.11-SNAPSHOT: not found

这很奇怪,因为我要下载的快照绝对在该存储库中。那么我到底在做什么错呢?我应该如何配置我的构建文件?解析程序上的sbt页面无法帮助 http://www.scala-sbt。 org / 0.13 / docs / Resolvers.html :/

Which is strange, because the snapshot I'm trying to download is most definitely in that repo. So what exactly am I doing wrong ? How instead should I be configuring my build file ? The sbt page on resolvers is not helping http://www.scala-sbt.org/0.13/docs/Resolvers.html :/

推荐答案

%% 告诉 sbt 应该将当前使用的Scala版本附加到工件上,然后下载该版本,因此基本上是在下载 geow_2.12 尚未发布,您可以从此处

%% tells sbt that it should append the current version of Scala being used to the artifacts and then download that one, so it's basically looking to download geow_2.12 which hasn't been published as you can see from here.

您可以通过将其更改为以下内容来明确指定要下载的文件:

You can explicitly specify which one to download by changing it to:

io.plasmap% geow_2.11% 0.3.11-SNAPSHOT

请注意,它可能与Scala 2.12二进制不兼容,因此您可能需要将 scalaVersion 更改为2.11.8才能使用该库(此时可以显然回到使用 %% n otation)。为多个Scala版本构建库的概念称为交叉构建,您可以阅读有关它的更多信息此处

Note that it may be binary incompatible with Scala 2.12, so you may need to change your scalaVersion to 2.11.8 in order to use that library (at which point you can obviously go back to using %% notation). This concept of building a library for multiple Scala versions is called cross-building and you can read more about it here.

这篇关于oss.sonatype.org的SBT解析器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆