jenkins+checkstyle
一、新增一个自由风格的项目
建好之后如下图所示
二、修改pom.xml文件
在项目根目录下添加如下代码(此处添加的3个插件)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.15</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<failsOnError>false</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<!-- <dependencies>
<dependency>
<groupId>com.example.build-tools</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.6</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<rulesets>
<ruleset>pmd.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.3</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<!--<xmlOutputDIrectory>target/site</xmlOutputDirectory>-->
<!--<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
<includeFilterFile>findbugs-include.xml</includeFilterFile>-->
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
<!-- <modules>
<module>build-tools</module>
<module>toycar-poss-manage</module>
</modules> -->
</project> <!--在这一层添加-->
修改完pom.xml后还需要添加自定义的checkstyle.xml 和pmd.xml 和findbugs.xml
注意:需要注意的是 如果项目为聚合项目则需要在每个子项目中都添加checkstyle.xml 和pmd.xml 和findbugs.xml
jenkins+checkstyle的更多相关文章
- jenkins checkstyle:local variable hides a field
源代码: 1 2 3 4 5 6 7 8 //应用上下文 private static ApplicationContext applicationContext; public static voi ...
- Jenkins系列——使用checkstyle进行代码规范检查
1.目标 通过jenkins使用checkstyle对代码进行规范检查并生成html报告. 构建采用shell. 2.环境 checkstyle5.7(如果是Linux版本选用tar.gz格式) ap ...
- jenkin插件整理
分类 plugin名称 wiki地址 源码地址 plugin作用范围 备注 Build Reports构建报告(此类插件用来分析构建结果,比果代码检查,测试CASE分析,并将这些结果以报表,趋势图等形 ...
- Docker+Jenkins持续集成环境(3)集成PMD、FindBugs、Checkstyle静态代码检查工具并邮件发送检查结果
为了规范代码,我们一般会集成静态代码检测工具,比如PMD.FindBugs.Checkstyle,那么Jenkins如何集成这些检查工具,并把检查结果放到构建邮件里呢? 今天做了调研和实现,过程如下 ...
- Jenkins系列——使用checkstyle进行代码规范检查【升级版】
1.背景 在<Jenkins系列——使用checkstyle进行代码规范检查>一文中完成了ant实现代码规范检查的例子.但存在以下缺陷: 每个作业都需要配置一个不同的checkstyle ...
- jenkins插件findbugs+pmd+checkstyle结合sonar与maven(java环境代码质量和代码规范管理)
一.下载jdk并安装(最好jdk官网下载解压安装的) 二.下载maven并安装maven 三.安装jenkins及插件 安装checkstyle.pmd.findbugs.maven.sonar等相关 ...
- Jenkins 配置 FindBugs,Checkstyle,PMD 实现代码的静态检查 (14)
一.插件介绍 FindBugs:静态分析工具,它检查类或者 JAR 文件,将字节码与一组缺陷模式进行对比以发现可能的问题.利用这个工具,就可以在不实际运行程序的情况对软件进行分析.它可以帮助改进代码的 ...
- jenkins+findbugs+checkstyle+PMD静态代码检查(二)
可以根据自己的需求选中对应的插件进行配置(不一定非要同时配置三个插件) jenkins:持续集成的工具 fundbugs:检测代码静态错误的插件 例如:定义了没有用到的对象,string类型的比较使 ...
- 干货!Jenkins下配置findbugs、pmd及checkstyle实现代码自动检测
配置前提: 对于maven项目来说,需要在pom.xml文件的<build><plugins>添加配置</plugins></build> 网上有些地方 ...
随机推荐
- Dreamweaver 中文乱码
定义当前页面的编码属性 Ctrl+j 标题/编码 将编码改成UTF8即可 PhpStorm FILE->Setting->File Encoding->将U ...
- Unknown picture file extension
Image1.Picture.LoadFromFile('aaa.jpg'); Project Project1.exe raised exception class EInvalidGraphic ...
- 简单的mysql热备
最近一直担心数据出问题,还好领导给了一台备用机,装好mysql后搜了下mysq热备相关的帖子,看似好繁琐,自己大概配置了一下擦发现起始很简单! 下边就是步骤了! 1.修改主从mysql配置文件,在my ...
- AOP的MethodBeforeAdvice
使用Spring自动生成代理类,spring利用的是动态代理机制 接口 Java代码 public interface UserDao { void addUser(); void deleteUse ...
- MongoDB常用增删改查语句
数据库database 创建及查看库 1.有则使用这个数据库,没有就创建 use DATABASE_NAME 2. 查看当前选择的数据库,默认是test db 3.查看数据库,默认有admin.loc ...
- SQL select 执行顺序
一.sql语句的执行步骤:1)语法分析,分析语句的语法是否符合规范,衡量语句中各表达式的意义.2)语义分析,检查语句中涉及的所有数据库对象是否存在,且用户有相应的权限.3)视图转换,将涉及视图的查询语 ...
- Texture Format全解析
[Texture Format全解析] What internal representation is used for the texture. This is a tradeoff between ...
- Opencv Match Template(轮廓匹配)
#include <iostream>#include <opencv2/opencv.hpp> using namespace std;using namespace cv; ...
- 381. Insert Delete GetRandom O(1) - Duplicates allowed允许重复的设计1数据结构
[抄题]: Design a data structure that supports all following operations in average O(1) time. Note: Dup ...
- 136. Single Number唯一的数字
[抄题]: Given an array of integers, every element appears twice except for one. Find that single one. ...