spotless-maven-plugin java代码自动格式化mvn spotless:apply -fn

2019/04/16 17:28
阅读数 289
<plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>1.20.0</version>
          <configuration>
            <java>
              <!-- include all java files in "java" folders under "src" -->
              <includes>
                <include>src/**/java/**/*.java</include>
              </includes>
              <googleJavaFormat>
                <!-- Optional, available versions: https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.googlejavaformat%22%20AND%20a%3A%22google-java-format%22 -->
                <version>1.7</version>
                <!-- Optional, available versions: GOOGLE, AOSP  https://github.com/google/google-java-format/blob/master/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java -->
                <style>GOOGLE</style>
              </googleJavaFormat>
            </java>
          </configuration>
        </plugin>

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部