maven 添加 checkstyle 插件约束代码规范

本例示例,是引用 http 链接这种在线 checkstyle.xml 文件的配置方式,如下示例:

xml 复制代码
    <properties>
        <maven.checkstyle.plugin.version>3.3.0</maven.checkstyle.plugin.version>
        <!--支持本地绝对路径、本地相对路径、HTTP远程路径-->
        <checkstyle.config.location>http://xxx.test.com/repository/raw-hosted/scripts/checkstyle/checkstyle.xml</checkstyle.config.location>
        <!--这样配置suppressions规则设定需要排除不检查的文件-->
        <checkstyle.suppressions.location/>
    </properties>
  
  <!--省略-->
  
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.plugin.version}</version>
                <configuration>
                    <consoleOutput>true</consoleOutput>
                    <violationSeverity>error</violationSeverity>
                    <detail>true</detail>
                </configuration>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <failOnViolation>true</failOnViolation>
                            <failsOnError>false</failsOnError>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
相关推荐
*.✧屠苏隐遥(ノ◕ヮ◕)ノ*.✧5 小时前
《苍穹外卖》- day01 开发环境搭建
spring boot·后端·spring·maven·intellij-idea·mybatis
Getgit6 小时前
Linux 下查看 DNS 配置信息的常用命令详解
linux·运维·服务器·面试·maven
HellowAmy10 小时前
我的C++规范 - 随机时间点
开发语言·c++·代码规范
tkevinjd16 小时前
4-初识Maven
java·maven
HellowAmy16 小时前
我的C++规范 - 回调的设想
开发语言·c++·代码规范
多多*1 天前
图解Redis的分布式锁的历程 从单机到集群
java·开发语言·javascript·vue.js·spring·tomcat·maven
aloha_7892 天前
乐信面试准备
java·spring boot·python·面试·职场和发展·maven
摇滚侠2 天前
解决 IntelliJ IDEA 中 Maven 管理界面不是层级结构的问题
java·maven·intellij-idea
a程序小傲3 天前
Maven 4 要来了:15 年后,Java 构建工具迎来“彻底重构”
java·开发语言·spring boot·后端·spring·重构·maven
凌冰_3 天前
Thymeleaf Maven+Servlet+Mysql图书框架—4(十)
mysql·servlet·maven