Sbt Spotless

An sbt plugin for Spotless code formatter/checker
Alternatives To Sbt Spotless
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Sbt Dependency Graph1,241
2 years ago56apache-2.0Scala
sbt plugin to create a dependency graph for your project
Intellij Scala1,106
5 days ago1apache-2.0Scala
Scala plugin for IntelliJ IDEA
Scala Steward1,069
3 days ago8January 25, 202274apache-2.0Scala
:robot: A bot that helps you keep your Scala projects up-to-date
Sbt Updates723
12 days ago14bsd-3-clauseScala
sbt plugin that can check Maven and Ivy repositories for dependency updates
Sbt Scoverage619
23 days ago35apache-2.0Scala
sbt plugin for scoverage
Twirl521232082 days ago35October 16, 201938apache-2.0Scala
Twirl is Play's default template engine
Android Plugin485
8 years ago52otherScala
An sbt plugin for Android development in Scala
Akka Grpc4194172 days ago40September 26, 2022165otherScala
Akka gRPC
Sbt Web357
3 years ago26otherScala
Library for building sbt plugins for the web
Sbt Git335
4 months ago29bsd-2-clauseScala
A git plugin for sbt
Alternatives To Sbt Spotless
Select To Compare

Alternative Project Comparisons

sbt-spotless Scala CI Maven Central

An sbt plugin for Spotless code formatter/checker.


Maven Central

in your plugins.sbt:

addSbtPlugin("net.moznion.sbt" % "sbt-spotless" % "0.1.3")

Supported sbt versions

  • sbt 1.3
  • sbt 0.13

This plugin supports the legacy sbt 0.13, but the legacy one has some issue on dynamic dependency resolution (see also known issue) and there might be some unexpected behavior potentially. Also an author doesn't motivate to maintenance the "legacy sbt" in the future continuously/positively, so there will a possibility to give up the support without notice. So I highly recommend considering to upgrade the sbt to 1.3.


Check the code format

$ sbt spotlessCheck

Apply the code formatter

$ sbt spotlessApply

Supported formatters

Format Implemented

Supporting other formats is under working. And of course, pull-request is welcome.


Please refer to the following wiki page: Configurations

Dynamic dependency

Spotless tries to reduce the static dependencies of various formatters, so spotless resolves the dependencies for formatters on-the-fly if the formatter is needed.

Basically, Spotless runner resolves the dynamic dependencies every time, that is not efficient. So this plugin caches the dynamic dependencies into files once that has resolved deps. And after that, it runs Spotless with cached libraries.

Known issues

(sbt 1.3) Some formatter cannot resolve the dynamic dependency

On some formatter, this plugin (i.e. Ivy2) cannot resolve dependencies of the formatter dynamically so it needs to declare the dependencies explicitly in your build.sbt.


libraryDependencies ++= List(
  "org.eclipse.platform" % "" % "1.3.600", // FIXME workaround for dynamic dependency resolution
  "com.diffplug.spotless" % "spotless-eclipse-groovy" % "3.5.0", // FIXME workaround for dynamic dependency resolution


libraryDependencies ++= List(
  "org.eclipse.platform" % "" % "1.3.600", // FIXME workaround for dependency resolution
  "com.diffplug.spotless" % "spotless-eclipse-cdt" % "9.9.0", // FIXME workaround for dependency resolution

(sbt 0.13) Some formatter cannot resolve the dynamic dependency

In sbt 0.13, highly recommend disabling dynamic dependency resolution by setting disableDynamicDependencyResolving true and specify the required dependencies explicitly in your build.sbt.

For example, in case of Java, let's specify like "" % "google-java-format" % "1.7", and in case of Scala, please specify "org.scalameta" %% "scalafmt-core" % "2.0.1".

For developers

How to run tests

sbt clean scripted

This scripted test caches the result of resolved dynamic dependency.

If you would like to clear the cache, please remove the contents that are in a directory: plugin/target/.dyn-dep-test/. FYI, sbt clean also clears the cache.

How to release this plugin to maven central

sbt release

How to try this plugin on local

$ sbt publishLocal


moznion ([email protected])


Copyright 2020 moznion (

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
Popular Plugin Projects
Popular Sbt Projects
Popular Libraries Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Sbt Plugin