我正在尝试将我的SBT项目发布到my存储库。我正在按照这些链接上的指示:
http://www.scala-sbt.org/release/docs/Using-Sonatype.html和https://github.com/xerial/sbt-pack
当我将xerial插件添加到我的build.sbt文件中时:
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") 编译器给出了以下错误:
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。我怎么才能解决这个问题?谢谢!
发布于 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即可。
https://stackoverflow.com/questions/46860492
复制相似问题