Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Checkstyle Maven插件执行不';当使用google\u检查时,不会因错误而失败_Java_Maven_Checkstyle_Maven Checkstyle Plugin - Fatal编程技术网

Java Checkstyle Maven插件执行不';当使用google\u检查时,不会因错误而失败

Java Checkstyle Maven插件执行不';当使用google\u检查时,不会因错误而失败,java,maven,checkstyle,maven-checkstyle-plugin,Java,Maven,Checkstyle,Maven Checkstyle Plugin,我正在使用版本3.0.0和Checkstyle 6.18中的 这是我的初始配置: <properties> <maven.checkstyle.plugin.version>3.0.0</maven.checkstyle.plugin.version> </properties> <build> <plugins> <plugin> <groupId

我正在使用版本3.0.0和Checkstyle 6.18中的

这是我的初始配置:

<properties>
    <maven.checkstyle.plugin.version>3.0.0</maven.checkstyle.plugin.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${maven.checkstyle.plugin.version}</version>
            <configuration>
                <failsOnError>true</failsOnError>
                <failOnViolation>true</failOnViolation>
            </configuration>
        </plugin>
    </plugins>
</build>
但是,当我使用
google\u checks.xml
时,构建成功,没有任何错误(
target/checkstyle report.xml
仍然显示问题)


org.apache.maven.plugins

为此。

在google_checks.xml中,严重性标记为失败。将其更改为错误会导致检查失败

原件:

<property name="severity" value="warning"/>

更新:

<property name="severity" value="error"/>

在Maven配置中,您还可以调整失败的严重性:

<configuration>
    <encoding>UTF-8</encoding>
    <consoleOutput>true</consoleOutput>
    <failsOnError>true</failsOnError>
    <failOnViolation>true</failOnViolation>
    <violationSeverity>warning</violationSeverity>
    <linkXRef>false</linkXRef>
</configuration>

UTF-8
真的
真的
真的
警告
假的

您能否验证将Checkstyle的CLI与google配置一起使用会产生冲突?如果是这样,那么你的maven配置就是问题所在。我知道maven就是问题所在。我正试图找出到底是什么地方出了问题,因为它可以很好地用于默认的日光检查。运行Checkstyle CLI适用于任何配置。
<property name="severity" value="error"/>
<configuration>
    <encoding>UTF-8</encoding>
    <consoleOutput>true</consoleOutput>
    <failsOnError>true</failsOnError>
    <failOnViolation>true</failOnViolation>
    <violationSeverity>warning</violationSeverity>
    <linkXRef>false</linkXRef>
</configuration>