我正在使用 maven 一尘不染的插件来格式化 java 文件,但它不能跳过文件。我用过exclude
and toggle off
,都不管用。
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.6.1</version>
<configuration>
<formats>
<format>
<!-- define the files to apply to -->
<includes>
<include>*.java</include>
</includes>
<excludes>
<exclude>api/**/RayCall.java</exclude>
<exclude>api/**/ActorCall.java</exclude>
<exclude>runtime/*/generated/**/*.*</exclude>
</excludes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<tabs>true</tabs>
<spacesPerTab>2</spacesPerTab>
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<toggleOffOn>
<off>// Generated by `RayCallGenerator.java`. DO NOT EDIT.</off>
</toggleOffOn>
<googleJavaFormat>
<version>1.7</version>
<style>GOOGLE</style>
</googleJavaFormat>
</java>
</configuration>
</plugin>