1

插件.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”。那有什么问题?

4

2 回答 2

2

请改用 1.1.0。

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

于 2013-09-01T13:16:54.107 回答
1

这适用于我的 Build.scala:

import com.typesafe.sbt.SbtScalariform.scalariformSettings

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

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

于 2014-04-30T19:21:34.600 回答