简体   繁体   中英

Java Code Formatter for SBT

Is there any sbt plugin for Java projects for Java code formatting? I did a little search but it seems like all of the sbt-based formatters are for Scala's syntax.

We have just released an initial version of the Lightbend sbt-java-formatter ( https://github.com/typesafehub/sbt-java-formatter )

You can use it by adding it to your project/plugins.sbt :

addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % JavaFormatterVersion)

and providing a project/formatting-java.xml file that is the exported Eclipse code formatter settings, for example like the Google Java style , and then tweak it the way you like it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM