【问题标题】:Sbt can't find SbtScalariformSbt 找不到 SbtScalariform
【发布时间】:2014-05-01 03:21:34
【问题描述】:

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”。这有什么问题?

【问题讨论】:

    标签: scala sbt


    【解决方案1】:

    改用 1.1.0。

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

    【讨论】:

    • [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-scalariform;1.1.0: not found
    【解决方案2】:

    这适用于我的 Build.scala:

    import com.typesafe.sbt.SbtScalariform.scalariformSettings
    
    lazy val proj = Project("app", file("."),
      settings = Defaults.defaultSettings ++ scalariformSettings ++ Seq(...))
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-02
      • 2018-04-24
      • 1970-01-01
      • 2019-01-08
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多