我尝试使用sbt-osgi插件,但无法加载它的AutoPlugin
,编译器拒绝编译我的代码。由于类型不匹配错误,无法加载SbtOsgi AutoPlugin
首先,我添加插件的最新版本project/plugins.sbt
:
resolvers += Classpaths.sbtPluginSnapshots
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.8.0-SNAPSHOT")
在那之后,我将在project/build.properties
的SBT版本:
sbt.version=0.13.7
然后,我创建project/Build.scala
具有以下内容:
import sbt._
import com.typesafe.sbt.osgi.SbtOsgi
object Build extends sbt.Build {
lazy val fooProject = Project("foo-project", file("."))
.enablePlugins(SbtOsgi)
}
但是,这sults以下错误信息:
[info] Loading project definition from .../sbt-osgi-test/project
[info] Compiling 1 Scala source to .../sbt-osgi-test/project/target/scala-2.10/sbt-0.13/classes...
[error] .../sbt-osgi-test/project/Build.scala:10: type mismatch;
[error] found : com.typesafe.sbt.osgi.SbtOsgi.type
[error] required: sbt.Plugins
[error] .enablePlugins(SbtOsgi)
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
此错误消息没有任何意义,因为AutoPlugin
延伸sbt.Plugins
。可能是什么问题呢?