sbt-java-formatter 0.13.1 is cross-published for:
| sbt Version | Published |
|---|---|
| 1.x | ✅ |
| 2.x | ✅ |
Highlights
This release adds support for preserving the existing modifier order in Java sources, upgrades the default Java 21 formatter runtime to google-java-format 1.36.1, and builds the sbt 2.x plugin against the final sbt 2.0.0 release.
Migration
No configuration changes are required. Modifier reordering remains enabled by default, matching the behavior of previous releases.
The formatter selected by javafmtFormatterCompatibleJavaVersion := 21 has been upgraded from google-java-format 1.35.0 to 1.36.1. Because formatter upgrades can produce formatting changes, consider running javafmtAll once and reviewing the result.
To preserve the existing modifier order, use:
ThisBuild / javafmtReorderModifiers := falseDisabling modifier reordering requires the Java 21 formatter runtime line because the Java 11 and Java 17 lines do not support the necessary --skip-reordering-modifiers CLI flag:
ThisBuild / javafmtFormatterCompatibleJavaVersion := 21The formatter JVM must therefore run on Java 21 or newer. If sbt itself runs on an older JDK, point the formatter to a compatible JDK using SBT_JAVAFMT_JAVA_HOME or -Dsbt-javafmt.java.home=....
New
- The new
javafmtReorderModifierssetting controls whethergoogle-java-formatreorders modifiers into JLS order. It is enabled by default. javafmtOptions.reorderModifiers(false)is now also honored, although the dedicatedjavafmtReorderModifierssbt setting is preferred.- The Java 21 formatter runtime now uses
google-java-format 1.36.1, which adds initial formatting support for Markdown documentation comments (///). - The sbt 2.x plugin is now built against the final sbt 2.0.0 release.
What's Changed
- google-java-format 1.36.1 by @mkurz in #304
- bump: scalafmt-core 3.11.2 (was 3.11.0) by @scala-steward in #298
- bump: scalafmt-core 3.11.5 (was 3.11.2) by @scala-steward in #303
- bump: sbt-scalafmt 2.6.2 (was 2.6.0) by @scala-steward in #301
- bump: sbt, scripted-plugin 1.12.14 (was 1.12.9) by @scala-steward in #300
- bump: sbt-ci-release 1.12.0 (was 1.11.2) by @scala-steward in #297
- build(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in #295
- sbt 2.0.0 by @xuwei-k in #294
- bump: scala3-library 3.8.4 (was 3.8.3) by @scala-steward in #292
- Support
reorderModifiers = falsevia google-java-format CLI by @mkurz in #266
Full Changelog: v0.12.0...v0.13.1