1

当我尝试安装 scalariform 插件时:

构建.sbt:

resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")

我收到 sbt 错误:

[

trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-scalariform;1.6.0: not found
[error] Total time: 1 s, completed 24-Mar-2016 23:51:57
>

我需要特定版本的 scalari 插件吗?

4

1 回答 1

3

下面的项目结构有效。似乎无法从 build.sbt 添加插件,需要在 /project/plugins.sbt 中。

/project/plugins.sbt :

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")

构建.sbt:

scalariformSettings

.scala 文件需要在文件夹 src/main/scala 中才能被 scalariform 格式化

于 2016-03-25T08:23:12.320 回答