现在我不知何故弄乱了我的全局 sbt 插件(~/.sbt/plugins/build.sbt
)。Scala 2.9.1 似乎是 sbt 0.11.3 想要的版本,并且所有插件(sbt-gpg-plugin、sbt-idea-plugin)都是针对 2.9.1 发布的。
现在无论我做什么,它都会不断尝试找到它们是针对 2.9.2 构建的:
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.github.mpeltonen:sbt-idea:1.0.0 (sbtVersion=0.11.3, scalaVersion=2.9.2)
[warn] com.jsuereth:xsbt-gpg-plugin:0.6 (sbtVersion=0.11.3, scalaVersion=2.9.2)
...
[error] {file:...}default-50be6e/*:update: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;1.0.0: not found
我该如何解决这个问题,以便 sbt 像以前一样检索 Scala 2.9.1 的插件?
为了完整起见,这是我的文件如何处理建议:
// project-home/build.sbt
scalaVersion := "2.9.2"
...
// project-home/project/plugins.sbt
resolvers += "less is" at "http://repo.lessis.me"
addSbtPlugin( "me.lessis" % "ls-sbt" % "0.1.1" )
scalaVersion := "2.9.1" // "just in case it helps"
// ~/.sbt/plugins/build.sbt
scalaVersion := "2.9.1" // "just in case it helps"
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
resolvers += Resolver.url( "sbt-plugin-releases", url( "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases" ))( Resolver.ivyStylePatterns )
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")
addSbtPlugin( "com.jsuereth" % "xsbt-gpg-plugin" % "0.6" )
更糟糕的是,即使我删除了 ~/.sbt/plugins/build.sbt
. 所以没有更多对 sbt-idea 或 xsbt-gpg-plugin 的引用(至少对我可见)。我仍然无法编译任何项目,因为 sbt 仍然试图找到这两个插件。史诗般的失败。