Sbt找不到SbtScalariform

时间:2013-09-01 13:03:54

标签: scala sbt

plugins.sbt

resolvers += Classpaths.typesafeResolver

resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"

resolvers += Resolver.sonatypeRepo("public")

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.0-SNAPSHOT")

addSbtPlugin("com.typesafe.startscript" % "xsbt-start-script-plugin" % "0.5.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.0.0")

addSbtPlugin("org.scalaxb" % "sbt-scalaxb" % "1.1.2")

Build.scala的部分:

lazy val formatSettings = SbtScalariform.scalariformSettings ++ Seq(
    ScalariformKeys.preferences in Compile := formattingPreferences,
    ScalariformKeys.preferences in Test    := formattingPreferences
  )

sbt版本是0.13。错误是“not found: value SbtScalariform”。这有什么问题?

2 个答案:

答案 0 :(得分:2)

改用1.1.0。

addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.1.0")

答案 1 :(得分:1)

这适用于我的Build.scala:

import com.typesafe.sbt.SbtScalariform.scalariformSettings

lazy val proj = Project("app", file("."),
  settings = Defaults.defaultSettings ++ scalariformSettings ++ Seq(...))

希望这有助于未来的用户。自述文件导入错误。