Scalafmt plugin for maven
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A wrapper that allows the use of the Scalafmt formatter in Maven.


The versioning of this plugin follows the following format:


Current supported versions (of Scalafmt) are 1.1.0 - 1.5.1. For example, to use the latest version of the plugin with the latest version of scala-fmt you should set the version to 0.9_1.5.1 in your pom. Note scala.version refers to binary versions of scala i.e. 2.11 or 2.12.


Add the following snippet to your pom; anything in <parameters> will be passed through to the CLI as is.

    <parameters>--diff</parameters> <!-- (Optional) Additional command line arguments -->
    <skip>false</skip> <!-- (Optional) skip formatting -->
    <skiptest>false</skip> <!-- (Optional) Skip formatting test sources -->
    <skipmain>false</skip> <!-- (Optional) Skip formatting main sources -->
    <configLocation>${project.basedir}/path/to/scalafmt.conf</configLocation> <!-- (Optional) config locataion -->
    <sourceDirectories> <!-- (Optional) Paths to source-directories. Overrides ${} -->
    <testSourceDirectories> <!-- (Optional) Paths to test-source-directories. Overrides ${} -->