繁体   English   中英

使用xsbt-gpg-plugin未解析的依赖项无法使用sbt 0.13上传到sonatype:com.jsuereth#xsbt-gpg-plugin; 0.6

[英]Fail to upload to sonatype with sbt 0.13 with xsbt-gpg-plugin unresolved dependency: com.jsuereth#xsbt-gpg-plugin;0.6

我的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-plugin-releases:试过[警告]
http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/com.jsuereth/xsbt-gpg-plugin/scala_2.10/sbt_0.13/0.6/ivys/ivy.xml [warn] :::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::: [警告] ::
无法解决的依赖:: [警告] ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::: [warn] :: com.jsuereth#xsbt-gpg-plugin; 0.6:找不到[warn] :::::::::::::::::::::::::::: :::::::::::::::::::::: [warn] [warn]注意:一些未解析的依赖项具有额外的属性。 检查这些依赖项是否与请求的属性一起存在。 [warn] com.jsuereth:xsbt-gpg-plugin:0.6(sbtVersion = 0.13,scalaVersion = 2.10)[warn] sbt.ResolveException:未解析的依赖:com.jsuereth#xsbt-gpg-plugin; 0.6:在sbt找不到。 IvyActions $ .sbt $ IvyActions $$ resolve(IvyActions.scala:217)at 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

我还在~/.sbt/0.13/sonatype.sbt留下了我的凭证:

credentials += Credentials("Sonatype Nexus Repository Manager",
                           "oss.sonatype.org",
                           "user-name", "pass-word")

这样我可以做sbt publish-signed


这是插件文档 (如您所见,已有更新版本可用)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM