如何让Spotless Maven插件格式化所有的Kotlin源文件?
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<executions>
<execution>
<id>spotless-apply</id>
<phase>compile</phase>
<configuration>
<kotlin>
<ktlint/>
</kotlin>
</configuration>
<goals>
<goal>apply</goal>
</goals>
</execution>
</executions>
</plugin>发布于 2021-04-28 03:17:59
不确定为什么你当前的配置不能工作,也许是因为配置在执行块中?如果您将其上移一级,然后用check替换apply,它将会正常工作。
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<kotlin>
<ktlint />
</kotlin>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>https://stackoverflow.com/questions/67272167
复制相似问题