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>
相关推荐
TlYf NTLE11 小时前
Spring Boot spring-boot-maven-plugin 参数配置详解
spring boot·后端·maven
❀͜͡傀儡师17 小时前
Maven Versions Plugin 使用指南
maven
ckm紫韵17 小时前
Maven搭建私服Nexus教程
java·maven·nexus
我是若尘1 天前
我的需求代码被主干 revert 了,接下来我该怎么操作?
前端·后端·代码规范
福运常在1 天前
股票数据API(19)次新股池数据
java·python·maven
回到原点的码农2 天前
maven导入spring框架
数据库·spring·maven
人机与认知实验室2 天前
Maven与以色列福音系统有何区别?
java·maven
方安乐2 天前
ESLint代码规范(二)
前端·javascript·代码规范
※DX3906※2 天前
SpringBoot之旅4: MyBatis 操作数据库(进阶) 动态SQL+MyBatis-Plus实战,从入门到熟练,再也不踩绑定异常、SQL拼接坑
java·数据库·spring boot·spring·java-ee·maven·mybatis
Meepo_haha2 天前
Maven Spring框架依赖包
java·spring·maven