Maven Maven Spotless插件格式Kotlin源代码
如何让Spotless Maven插件格式化所有Kotlin源文件Maven Maven Spotless插件格式Kotlin源代码,maven,kotlin,spotless,Maven,Kotlin,Spotless,如何让Spotless Maven插件格式化所有Kotlin源文件 <plugin> <groupId>com.diffplug.spotless</groupId> <artifactId>spotless-maven-plugin</artifactId> <executions> <execution> <id>spotless-a
<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>
一尘不染
一尘不染的maven插件
一尘不染
编译
应用
不确定当前配置为什么不工作,可能是因为配置在执行块中?如果您将其向上移动一级,然后将应用
替换为检查
,它将工作
<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>
一尘不染
一尘不染的maven插件
编译
检查
在我按照您的建议移动配置后,将目标更改为“应用”起到了作用。