首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将addSbtPlugin("org.xerial.sbt“%”sonatype“% "1.1")添加到我的项目中,”未解决的依赖项“将失败

将addSbtPlugin("org.xerial.sbt“%”sonatype“% "1.1")添加到我的项目中,”未解决的依赖项“将失败
EN

Stack Overflow用户
提问于 2017-10-21 05:55:46
回答 1查看 650关注 0票数 0

我正在尝试将我的SBT项目发布到my存储库。我正在按照这些链接上的指示:

http://www.scala-sbt.org/release/docs/Using-Sonatype.htmlhttps://github.com/xerial/sbt-pack

当我将xerial插件添加到我的build.sbt文件中时:

代码语言:javascript
复制
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")   

编译器给出了以下错误:

代码语言:javascript
复制
UNRESOLVED DEPENDENCIES

org.xerial.sbt#sbt-sonatype;1.1 not found

Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13) (/richstat/build.sbt#L56-57)
[warn]        +- com.github.shafiquejamal:richstat_2.11:0.0.1

我的SBT版本是0.13,我正在使用Scala2.11。我怎么才能解决这个问题?谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-22 12:48:43

您必须在project/plugins.sbt中添加插件,因为插件是元项目的依赖项,而不是库/应用程序。

查看sbt文档:使用插件

另外,关于sbt版本和Scala版本:有用于编译项目代码的Scala版本(在您的示例中是2.11),还有sbt本身使用的Scala版本。后者由sbt版本决定: sbt-0.13使用Scala 2.10,sbt-1.0使用Scala 2.12。

我建议您更新到sbt-1.0.2:只需更改project/build.properties中的版本并使用sonatype 2.0即可。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46860492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档