Scala 无法上传到sbt为0.13的sonatype,xsbt gpg插件未解析依赖项:com.jsuereth#xsbt gpg插件;0.6

Scala 无法上传到sbt为0.13的sonatype,xsbt gpg插件未解析依赖项:com.jsuereth#xsbt gpg插件;0.6,scala,sbt,Scala,Sbt,我的plugins.sbt有以下功能: logLevel := Level.Warn addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "1.0.0") resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases")) (Resolver.ivySt

我的
plugins.sbt
有以下功能:

logLevel := Level.Warn

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "1.0.0")

resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases")) (Resolver.ivyStylePatterns)

addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
当我运行
sbt publish
时,我得到:

[警告]==sbt插件发布:已尝试[警告]
[警告]::::::::::::::::::::::::::::[警告]::
未解析的依赖项::[警告] :警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告:警告: com.jsuereth#xsbt gpg插件;0.6:未找到[警告] :::::::::注意: 某些未解析的依赖项具有额外属性。检查这些 依赖项与请求的属性一起存在。[警告] jsuereth:xsbt gpg插件:0.6(sbtVersion=0.13, scalaVersion=2.10)[警告]sbt.ResolveException:未解决 依赖项:com.jsuereth#xsbt gpg插件;0.6:在中找不到 sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)位于 sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:126)

因此,我尝试将
addSbtPlugin
更新为:

addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6",
  sbtVersion = "0.12",    // SBT version
  scalaVersion = "2.9.2" )
现在我明白了

[warn] The global sbt directory is now versioned and is located at /home//.sbt/0.13.
[warn]   You are seeing this warning because there is global configuration in /home//.sbt but not in /home//.sbt/0.13.
[warn]   The global sbt directory may be changed via the sbt.global.base system property.
[info] Loading project definition from /home//dev/projects/myproj/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
**java.lang.NoClassDefFoundError: sbt/Scoped$ListSetting**
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
不管怎样,你想修一下吗?
谢谢

我不确定,但我认为你使用的是一个相当旧版本的插件

我将以下内容与最新的sbt 0.13.6一起使用。我已经在
~/.sbt/0.13/plugins/build.sbt
中全局安装了这个:

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") // sign Sonatype artifacts
credentials += Credentials("Sonatype Nexus Repository Manager",
                           "oss.sonatype.org",
                           "user-name", "pass-word")
我还在
~/.sbt/0.13/sonatype.sbt
中留下了我的凭证:

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") // sign Sonatype artifacts
credentials += Credentials("Sonatype Nexus Repository Manager",
                           "oss.sonatype.org",
                           "user-name", "pass-word")
这样我就可以做
sbt发布签名


。(如您所见,已经有一个更新的版本可用)