我想执行一个Maven目标,但是由于Checkstyle错误的限制,我无法这样做。我现在没有时间去更正Checkstyle错误(我的Checkstyle规则最近已经更新,我现在不能处理所有的错误)。
有没有一种方法可以禁用Checkstyle操作并继续执行我的目标?
我想执行一个Maven目标,但是由于Checkstyle错误的限制,我无法这样做。我现在没有时间去更正Checkstyle错误(我的Checkstyle规则最近已经更新,我现在不能处理所有的错误)。
有没有一种方法可以禁用Checkstyle操作并继续执行我的目标?
mvn [target] -Dcheckstyle.skip
。随机编码者的答案是首选。
如果您想从pom中禁用checkstyle,可以将checkstyle插件添加到pom中并设置跳过标志以防止检查。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<properties>
<checkstyle.skip>true</checkstyle.skip>
</properties>
<skip.checkstyle>
。 - Jack Cole <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludes>path/to/your/class/from/sources/root/myclass.java</excludes>
</configuration>
</plugin>