Commit 43008b08 by zhaojing

Initial commit

parents
*.iml
*.ipr
*.iws
*.log
.DS_Store
.history
logs/
.idea/
target/
node_modules/
# qpm-dependencies
> Maven 统一依赖管理
## 功能特性
- 统一管理 jar 版本
- 简化项目中的 pom.xml
- 默认引入常用 jar、plugins 及配置公共配置
## 如何使用
在你的 `pom.xml` 中加入如下代码:
```xml
<parent>
<groupId>com.qipeng</groupId>
<artifactId>qpm-parent</artifactId>
<version>${version}</version>
</parent>
```
[点击查看最新版本](http://nexus.taovip.com/nexus)
### Example
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qipeng</groupId>
<artifactId>qpm-parent</artifactId>
<version>${version}</version>
</parent>
<artifactId>finance-mall</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<modules>
<module>finance-mall-impl</module>
<module>finance-mall-domain</module>
<module>finance-mall-rest</module>
</modules>
</project>
```
## Maintainers
- 架构组
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.qipeng</groupId>
<artifactId>checkstyle</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Credit Checkstyle Checker</name>
<description>Credit Checkstyle Checker</description>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.3</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.8.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.7.0</version>
<scope>test</scope>
</dependency>
<!-- Generally Useful Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.9.RELEASE</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.1</version>
</dependency>
<dependency>
<groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>sevntu-checkstyle-maven-plugin</artifactId>
<version>1.24.2</version>
</dependency>
<dependency>
<groupId>com.qipeng</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<configLocation>credit_checks.xml</configLocation>
<suppressionsLocation>credit_suppressions.xml</suppressionsLocation>
</configuration>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>validate</phase>
<configuration>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.taovip.com/nexus/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>releases</id>
<url>http://nexus.taovip.com/nexus/content/repositories/releases</url>
</repository>
</distributionManagement>
</project>
package com.qipeng.checkstyle.checks;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
/**
* Logger 对象定义的检查类。
*
* @author tieguanyin
*/
@SuppressWarnings("all")
public class LoggerNameCheck extends AbstractCheck {
@Override
public int[] getDefaultTokens() {
return getAcceptableTokens();
}
@Override
public int[] getAcceptableTokens() {
return new int[]{TokenTypes.VARIABLE_DEF};
}
@Override
public int[] getRequiredTokens() {
return getAcceptableTokens();
}
@Override
public void visitToken(DetailAST ast) {
DetailAST type = ast.findFirstToken(TokenTypes.TYPE).getFirstChild();
if ("Logger".equals(type.getText())) {
final DetailAST modifiersAst = ast.findFirstToken(TokenTypes.MODIFIERS);
final boolean isFinal = modifiersAst.branchContains(TokenTypes.FINAL);
final boolean isStatic = modifiersAst.branchContains(TokenTypes.LITERAL_STATIC);
if (!isFinal || !isStatic) {
log(type.getLineNo(), type.getColumnNo(), "Logger 必须以 static final 修饰");
}
DetailAST variableName = ast.findFirstToken(TokenTypes.IDENT);
if (!"logger".equals(variableName.getText())) {
log(type.getLineNo(), type.getColumnNo(), "Logger 必须以 logger 命名");
}
}
}
}
package com.qipeng.checkstyle.checks;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
/**
* 单行注释内容空格检查类。
*
* @author tieguanyin
*/
@SuppressWarnings("all")
public class SpacedCommentCheck extends AbstractCheck {
@Override
public int[] getDefaultTokens() {
return getAcceptableTokens();
}
@Override
public int[] getAcceptableTokens() {
return new int[]{TokenTypes.SINGLE_LINE_COMMENT};
}
@Override
public int[] getRequiredTokens() {
return CommonUtils.EMPTY_INT_ARRAY;
}
@Override
public boolean isCommentNodesRequired() {
return true;
}
@Override
public void visitToken(DetailAST ast) {
String comment = getCommentFirstLine(ast);
if (!isBlank(comment) && !comment.startsWith(" ")) {
log(ast.getLineNo(), "注释符 ''//'' 和注释内容之间应该保持一个空格。");
}
}
private static String getCommentFirstLine(DetailAST ast) {
String commentContent = "";
DetailAST firstChild = ast.getFirstChild();
if (firstChild != null && firstChild.getType() == TokenTypes.COMMENT_CONTENT) {
commentContent = firstChild.getText();
}
return commentContent;
}
private static boolean isBlank(CharSequence cs) {
int strLen = cs == null ? 0 : cs.length();
if (strLen == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(cs.charAt(i))) {
return false;
}
}
return true;
}
}
package com.qipeng.checkstyle.checks;
import antlr.CommonAST;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Spring MVC 注解检查类。
*
* @author tieguanyin
*/
@SuppressWarnings("all")
public class SpringMvcAnnotationCheck extends AbstractCheck {
private static final Map<String, String> REQUEST_MAPPINGS = new HashMap<>();
static {
REQUEST_MAPPINGS.put("ALL", "RequestMapping");
REQUEST_MAPPINGS.put("GET", "GetMapping");
REQUEST_MAPPINGS.put("POST", "PostMapping");
REQUEST_MAPPINGS.put("PUT", "PutMapping");
REQUEST_MAPPINGS.put("PATCH", "PatchMapping");
REQUEST_MAPPINGS.put("DELETE", "DeleteMapping");
}
@Override
public int[] getDefaultTokens() {
return getAcceptableTokens();
}
@Override
public int[] getAcceptableTokens() {
return new int[]{TokenTypes.ANNOTATION};
}
@Override
public int[] getRequiredTokens() {
return getAcceptableTokens();
}
@Override
public void visitToken(DetailAST ast) {
DetailAST annotation = ast.findFirstToken(TokenTypes.IDENT);
// 检查方法上的 @ResponseBody
if ("RestController".equals(annotation.getText())) {
DetailAST classAst = ast.getParent().getParent();
processResponseBodyAnnotation(classAst);
return;
}
// 检查方法上的 @XxxMapping
if (REQUEST_MAPPINGS.values().contains(annotation.getText())) {
List<DetailAST> pairs = findAllAnnotationMemberValuePair(ast);
if (pairs.size() == 1) {
DetailAST pair = pairs.get(0);
String paramName = pair.findFirstToken(TokenTypes.IDENT).getText();
if ("value".equals(paramName) || "path".equals(paramName)) {
log(pair.getLineNo(), pair.getColumnNo(), "@{0} 的参数名 value/path 可以省略",
annotation.getText());
}
return;
}
DetailAST methodAst = ast.getParent().getParent();
if (methodAst.getType() == TokenTypes.METHOD_DEF) {
DetailAST methodReturnType = methodAst.findFirstToken(TokenTypes.TYPE)
.findFirstToken(TokenTypes.IDENT);
if (methodReturnType != null && "Object".equals(methodReturnType.getText())) {
log(methodReturnType.getLineNo(), methodReturnType.getColumnNo(),
"Controller 方法的返回值应该使用确定类型,使用 Object 容易引入 bug");
}
}
if ("RequestMapping".equals(annotation.getText())) {
String method = pairs.stream()
.filter(a -> "method".equals(a.findFirstToken(TokenTypes.IDENT).getText()))
.findFirst()
.map(a -> a.findFirstToken(TokenTypes.EXPR).getFirstChild())
.map(a -> a.getChildCount() > 1
? a.findFirstToken(TokenTypes.IDENT).getNextSibling() : a)
.map(CommonAST::getText)
.orElse(null);
if (REQUEST_MAPPINGS.containsKey(method)) {
log(ast.getLineNo(), ast.getColumnNo(), "请将 @{0} 替换为更简洁的 @{1}",
annotation.getText(), REQUEST_MAPPINGS.get(method));
}
}
}
}
private void processResponseBodyAnnotation(DetailAST ast) {
if (!ast.branchContains(TokenTypes.ANNOTATION)) {
return;
}
DetailAST childAst = ast.getFirstChild();
while (childAst != null) {
if (childAst.getType() == TokenTypes.ANNOTATION
&& "ResponseBody".equals(childAst.findFirstToken(TokenTypes.IDENT).getText())) {
log(childAst.getLineNo(), childAst.getColumnNo(),
"RestController 方法的 @ResponseBody 可以省略");
} else {
processResponseBodyAnnotation(childAst);
}
childAst = childAst.getNextSibling();
}
}
private static List<DetailAST> findAllAnnotationMemberValuePair(DetailAST ast) {
List<DetailAST> asts = new ArrayList<>();
DetailAST child = ast.getFirstChild();
while (child != null) {
if (child.getType() == TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR) {
asts.add(child);
}
child = child.getNextSibling();
}
return asts;
}
}
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml"/>
<property name="cacheFile" value="target/checkstyleCache"/>
<!-- 检查文件是否以一个空行结束 -->
<module name="NewlineAtEndOfFile"/>
<!-- 检查文件长度 -->
<module name="FileLength"/>
<!-- 检查文件中是否含有 '\t' -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<!-- 正则检查 -->
<!-- See http://checkstyle.sf.net/config_regexp.html -->
<!-- 检查尾空格字符 -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<!-- 允许使用注解忽略 checkstyle 警告 -->
<!-- See http://checkstyle.sf.net/config_filters.html -->
<module name="SuppressWarningsFilter"/>
<!-- 检查是否存在重复的 properties -->
<module name="UniqueProperties">
<property name="fileExtensions" value="properties"/>
</module>
<!-- 每个 java 文件一个语法树 -->
<module name="TreeWalker">
<!-- 注解检查 -->
<!-- See http://checkstyle.sf.net/config_annotation.html -->
<!-- 检查注解位置 -->
<module name="AnnotationLocation">
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="false"/>
<property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
<property name="allowSamelineParameterizedAnnotation" value="false"/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="PARAMETER_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
<property name="allowSamelineSingleParameterlessAnnotation" value="true"/>
<property name="allowSamelineParameterizedAnnotation" value="true"/>
</module>
<!-- 检查注解样式 -->
<module name="AnnotationUseStyle"/>
<!-- 检查 @Deprecated 注解 -->
<module name="MissingDeprecated">
<property name="skipNoJavadoc" value="true"/>
</module>
<!-- 检查 @Override 注解 -->
<module name="MissingOverride"/>
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder"/>
<!-- 代码块检查 -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!-- 检查是否有嵌套代码块 -->
<module name="AvoidNestedBlocks"/>
<!-- 检查空代码块 -->
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<!-- 检查 catch 部分的空代码块 -->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<!-- 检查左大括号位置 -->
<module name="LeftCurly">
<property name="ignoreEnums" value="false"/>
</module>
<!-- 检查代码块是否缺失 {} -->
<module name="NeedBraces"/>
<!-- 检查右大括号位置 -->
<module name="RightCurly"/>
<!-- 类设计检查 -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- 检查只有 private 构造函数的类是否声明为 final -->
<!--<module name="FinalClass" />-->
<!-- 检查工具类是否有 public 构造器 -->
<module name="HideUtilityClassConstructor"/>
<!-- 检查内部类型是否定义在方法之后 -->
<module name="InnerTypeLast"/>
<!-- 检查接口是否仅定义类型 -->
<module name="InterfaceIsType"/>
<!-- 检查是否在一个类文件中是否只有一个顶级类 -->
<module name="OneTopLevelClass"/>
<!-- 检查方法抛出的异常数量 -->
<module name="ThrowsCount"/>
<!-- 检查类成员变量可见性 -->
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="protectedAllowed" value="true"/>
</module>
<!-- 一般代码检查 -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- 检查数组最后的逗号 -->
<module name="ArrayTrailingComma"/>
<!-- 检查是否有参数类型不合法的 equals 方法 -->
<module name="CovariantEquals"/>
<!-- 检查 switch 语句的 default 是否在最后 -->
<module name="DefaultComesLast"/>
<!-- 检查只有一个分号的空语句 -->
<module name="EmptyStatement"/>
<!-- 检查可能出现 NPE 的 equals 方法 -->
<module name="EqualsAvoidNull"/>
<!-- 检查在重写 equals 方法后是否重写 hashCode 方法 -->
<module name="EqualsHashCode"/>
<!-- 检查 switch case 语句是否有穿越 -->
<module name="FallThrough"/>
<!-- 检查局部变量是否隐藏了类中的变量 -->
<module name="HiddenField">
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<!-- 检查是否使用工厂方法实例化 -->
<module name="IllegalInstantiation"/>
<!-- 检查是否有用 Unicode 编码表示 \b、\t、\n、\f、\r、\"、\'、\\ 等字符 -->
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14
|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value
or Unicode escaped value."/>
</module>
<!-- 检查子表达式中是否有赋值操作 -->
<module name="InnerAssignment"/>
<!-- 检查是否有魔法数字 -->
<!--<module name="MagicNumber">-->
<!--<property name="ignoreHashCodeMethod" value="true" />-->
<!--<property name="ignoreAnnotation" value="true" />-->
<!--</module>-->
<!-- 检查 switch 语句是否有 default -->
<module name="MissingSwitchDefault"/>
<!-- 检查是否对控制变量进行修改 -->
<module name="ModifiedControlVariable">
<property name="skipEnhancedForLoopVariable" value="true"/>
</module>
<!-- 检查是否一行有多个变量定义 -->
<module name="MultipleVariableDeclarations"/>
<!-- 检查嵌套 for 的深度 -->
<module name="NestedForDepth">
<property name="max" value="1"/>
</module>
<!-- 检查嵌套 if 的深度 -->
<module name="NestedIfDepth">
<property name="max" value="2"/>
</module>
<!-- 检查嵌套 try 的深度 -->
<module name="NestedTryDepth">
<property name="max" value="2"/>
</module>
<!-- 检查是否覆写 Object.clone() -->
<module name="NoClone"/>
<!-- 检查是否覆写 Object.finalizer() -->
<module name="NoFinalizer"/>
<!-- 检查是否一行只有一个语句 -->
<module name="OneStatementPerLine"/>
<!-- 检查重载的方法是否按照顺序定义 -->
<module name="OverloadMethodsDeclarationOrder"/>
<!-- 检查包声明是否和路径一致 -->
<module name="PackageDeclaration"/>
<!-- 检查是否有对方法参数重新赋值 -->
<module name="ParameterAssignment"/>
<!-- 检查是否需要 this 前缀 -->
<module name="RequireThis">
<property name="checkMethods" value="false"/>
</module>
<!-- 检查是否有过度复杂的布尔表达式 -->
<module name="SimplifyBooleanExpression"/>
<!-- 检查是否有过于复杂的布尔返回值 -->
<module name="SimplifyBooleanReturn"/>
<!-- 检查是否有用 == 比较字符串相等 -->
<module name="StringLiteralEquality"/>
<!-- 检查变量定义和使用之间的距离 -->
<module name="VariableDeclarationUsageDistance"/>
<!-- import 检查-->
<!-- See http://checkstyle.sf.net/config_imports.html -->
<!-- 避免使用 * -->
<module name="AvoidStarImport"/>
<!-- 检查自定义导入顺序 -->
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
<property name="specialImportsRegExp" value="^org\."/>
<property name="thirdPartyPackageRegExp" value="^(com|net)\."/>
<property name="separateLineBetweenGroups" value="true"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
</module>
<!-- 检查是否从非法的包中导入了类 -->
<module name="IllegalImport"/>
<!-- 检查类导入的顺序 -->
<!--<module name="ImportOrder">-->
<!--<property name="option" value="above" />-->
<!--<property name="groups" value="java,javax,org,com,net" />-->
<!--<property name="ordered" value="true" />-->
<!--<property name="separated" value="true" />-->
<!--<property name="sortStaticImportsAlphabetically" value="true" />-->
<!--</module>-->
<!-- 检查是否导入了多余的包 -->
<module name="RedundantImport"/>
<!-- 没用的 import 检查,比如:
1. 没有被用到类
2. 重复的类
3. java.lang 的类
4. 与该类在同一个 package 的类 -->
<module name="UnusedImports"/>
<!-- 注释检查 -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!-- 检查 javadoc 中元素的顺序 -->
<module name="AtclauseOrder"/>
<!-- 检查方法和构造函数的 javadoc -->
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="2"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingJavadoc" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<!-- 检查段落的 javadoc -->
<module name="JavadocParagraph"/>
<!-- 检查 javadoc 的格式 -->
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
</module>
<!-- 检查标签的换行缩进 -->
<module name="JavadocTagContinuationIndentation">
<property name="offset" value="0"/>
</module>
<!-- 检查类和接口的 javadoc -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="authorFormat" value=".+"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<!-- 检查变量的 javadoc -->
<!--<module name="JavadocVariable">-->
<!--<property name="scope" value="public" />-->
<!--</module>-->
<!-- 检查描述后面的 at-clause tag -->
<module name="NonEmptyAtclauseDescription"/>
<!-- 检查单行的 javadoc -->
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<!-- 检查多行 javadoc -->
<!--<module name="SummaryJavadoc">-->
<!--<property name="forbiddenSummaryFragments"-->
<!--value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )" />-->
<!--</module>-->
<!-- 其他类检查 -->
<!-- http://checkstyle.sf.net/config_misc.html -->
<!-- 检查数组类型定义的样式 -->
<module name="ArrayTypeStyle"/>
<!-- 检查是否有对 Unicode 字符转义 -->
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<!-- 检查注释缩进是否正确 -->
<module name="CommentsIndentation"/>
<!-- 强制使用 Java 8 lambdas -->
<module name="DescendantToken">
<property name="tokens" value="METHOD_CALL"/>
<property name="limitedTokens" value="METHOD_DEF"/>
<property name="maximumNumber" value="0"/>
<property name="maximumMessage" value="Use Java 8 Lambdas!"/>
</module>
<!-- 检查代码缩进是否正确 -->
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
<!-- 检查 public 类名和文件名是否一致 -->
<module name="OuterTypeFilename"/>
<!-- 检查 long 型定义是否有大写的 “L” -->
<module name="UpperEll"/>
<!-- 修饰符检查 -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!-- 检查修饰符的顺序是否遵照 java 语言规范,默认:
public、protected、private、abstract、static、final、
transient、volatile、synchronized、native、strictfp -->
<module name="ModifierOrder"/>
<!-- 检查接口和 annotation 中是否有多余修饰符,如接口方法不必使用 public -->
<module name="RedundantModifier"/>
<!-- 命名规范检查 -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<!-- 检查驼峰式命名中的连续大写字母 -->
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<!-- 检查异常参数命名 -->
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
</module>
<!-- 检查 Class 类型参数命名 -->
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
</module>
<!-- 检查常量名(只允许大写)-->
<module name="ConstantName">
<!--<property name="format" value="^(.+Log|log)(ger)?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$" />-->
<property name="applyToPrivate" value="false"/>
</module>
<!-- 检查 Interface 类型参数命名 -->
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
</module>
<!-- 局部的 final 变量,包括 catch 中的参数检查 -->
<module name="LocalFinalVariableName"/>
<!-- 局部的非 final 型的变量,包括 catch 中的参数检查 -->
<module name="LocalVariableName"/>
<!-- 非 static 型变量检查 -->
<module name="MemberName"/>
<!-- 检查方法名 -->
<module name="MethodName">
<property name="format" value="^([a-z][a-z0-9][a-zA-Z0-9]*|\$[a-z][a-zA-Z]+)$"/>
</module>
<!-- 检查包名(只允许小写字母) -->
<module name="PackageName"/>
<!-- 检查方法参数名 -->
<module name="ParameterName "/>
<!-- 检查 static 型的变量(不包括 static final) -->
<module name="StaticVariableName"/>
<!-- 检查 Class 或 Interface 名 -->
<module name="TypeName"/>
<!-- 检查枚举类名(不能以 Enum 结尾,规范命名示例:UserType) -->
<module name="TypeName">
<property name="format" value="^[A-Z][a-zA-Z0-9]*(?&lt;!Enum)$"/>
<property name="tokens" value="ENUM_DEF"/>
<message key="name.invalidPattern"
value="枚举类名 ''{0}'' 不规范(不能以 Enum 结尾),规范示例:UserType"/>
</module>
<!-- 正则检查 -->
<!-- See http://checkstyle.sf.net/config_regexp.html -->
<!-- 检查是否有输出到控制台的语句 -->
<module name="RegexpSinglelineJava">
<property name="id" value="SystemOut"/>
<property name="format"
value="(System\.(out|err)\.print(ln|f)?|\.printStackTrace)\("/>
<property name="ignoreComments" value="true"/>
<property name="message" value="不要使用 System.out/err,请使用 SLF4J 替代。"/>
</module>
<!-- 检查单元测试导入 -->
<module name="RegexpSinglelineJava">
<property name="id" value="TestImport"/>
<property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)"/>
<property name="ignoreComments" value="true"/>
<property name="message" value="请使用 BDD 风格的验证:BDDMockito"/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="TestAssert"/>
<property name="format" value="org\.junit\.Assert\.assert"/>
<property name="ignoreComments" value="true"/>
<property name="message" value="请使用 AssertJ 替代 JUnit 做测试断言。"/>
</module>
<!-- 长度检查 -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- 检查匿名类长度 -->
<module name="AnonInnerLength">
<property name="max" value="100"/>
</module>
<!-- 检查每行字符是否超出限制 -->
<module name="LineLength">
<property name="max" value="100"/>
</module>
<!-- 检查方法长度是否超出限制 -->
<module name="MethodLength">
<property name="max" value="200"/>
</module>
<!-- 检查方法参数个数是否超出限制-->
<module name="ParameterNumber">
<property name="max" value="6"/>
<property name="ignoreOverriddenMethods" value="true"/>
</module>
<!-- 空格检查 -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!-- 检查 Iterator 相关的空格 -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<!-- 检查换行设置 -->
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="true"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="true"/>
</module>
<!-- 检查尖括号 -->
<module name="GenericWhitespace"/>
<!-- 检查方法名后是否跟左圆括号 "(" -->
<module name="MethodParamPad"/>
<!-- 检查是否对 package、import 语句换行 -->
<module name="NoLineWrap"/>
<!-- 检查操作符换行策略 -->
<module name="OperatorWrap">
<property name="option" value="nl"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<!-- 检查圆括号空白 -->
<module name="ParenPad"/>
<!-- 检查分隔符换行 -->
<module name="SeparatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="DOT, METHOD_REF"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="eol"/>
<property name="tokens" value="COMMA"/>
</module>
<!-- 检查需要空格分隔符的场景 -->
<module name="SingleSpaceSeparator">
<property name="validateComments" value="true"/>
</module>
<!-- 检查在类型转换时括号两边是否有空格 -->
<module name="TypecastParenPad"/>
<!-- 检查分隔符是否在空白之后 -->
<module name="WhitespaceAfter"/>
<!-- 检查分隔符周围是否有空白 -->
<module name="WhitespaceAround">
<property name="ignoreEnhancedForColon" value="false"/>
</module>
<!-- 扩展检查 -->
<!-- See https://github.com/sevntu-checkstyle/sevntu.checkstyle -->
<!-- 检查条件判断是否易于理解 -->
<module name="AvoidConditionInversion"/>
<!-- 检查在 finally 中是否有 return 语句 -->
<module name="ForbidReturnInFinallyBlock"/>
<!-- 检查 Map 遍历方式 -->
<module name="MapIterationInForEachLoop"/>
<!-- 检查变量是否可以定义到代码块 -->
<module name="MoveVariableInsideIf">
<message key="move.variable.inside" value="变量 ''{0}'' 可以定义到第 {1} 行的代码块中"/>
</module>
<!-- 检查是否有不必要的括号 -->
<module name="UnnecessaryParenthesesExtended"/>
<!-- 检查枚举类型名(同一个枚举类中命名风格必须一致,规范命名示例:FIRST_ELEMENT、FirstElement)-->
<module name="UniformEnumConstantName">
<message key="enum.name.format.violated"
value="枚举类型命名不规范,规范示例:FIRST_ELEMENT、FirstElement"/>
<message key="enum.name.formats.violated"
value="枚举类型命名不规范,规范示例:FIRST_ELEMENT、FirstElement"/>
</module>
<!-- 检查返回值是集合类的方法(不允许返回 null) -->
<module name="NoNullForCollectionReturn">
<property name="searchThroughMethodBody" value="false"/>
<message key="no.null.for.collections" value="返回零长度的数组或者集合,而不是 null"/>
</module>
<!-- 自定义检查 -->
<!-- 检查单行注释的空格 -->
<module name="com.qipeng.checkstyle.checks.SpacedCommentCheck"/>
<!-- 检查 Logger 定义 -->
<module name="com.qipeng.checkstyle.checks.LoggerNameCheck"/>
<!-- 检查 Spring MVC 注解 -->
<module name="com.qipeng.checkstyle.checks.SpringMvcAnnotationCheck"/>
</module>
</module>
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files=".*(Application|Benchmark|Test)\.java" id="SystemOut"/>
<suppress files=".*(Application|Benchmark|Test)\.java" checks="HideUtilityClassConstructor"/>
<suppress files="com[\\/].*[\\/]jooq[\\/].*\.java" checks=".*"/>
</suppressions>
package com.qipeng.checkstyle.demo;
import java.util.Collections;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Checkstyle Demo 类。
*
* @author tieguanyin
*/
@SuppressWarnings("all")
public class CheckDemo {
private static final Logger logger = LoggerFactory.getLogger(CheckDemo.class);
// a
public String sayHello(String name) { // b
//
// c
//
String newName = name;
if (name == null) {
String defaultName = "world";
newName = defaultName;
}
int a = 1;
int b = a * 2;
if (a != b) {
// test
return "Hello " + newName + "!"; // d
}
return "Hello " + newName + "!"; // d
}
public String[] newArray() {
return new String[0];
}
public List<String> newList() {
return Collections.emptyList();
}
enum DemoType {
FOO, BAR
}
enum DemoType2 {
FOO_TYPE, BAR_TYPE
}
enum DemoType3 {
Foo, Bar
}
}
package com.qipeng.checkstyle.demo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 测试 Checkstyle 的控制器。
*
* @author tieguanyin
*/
@RestController
// @Controller
// @ResponseBody
@RequestMapping("/foo")
@SuppressWarnings("all")
public class DemoController {
private static final Logger logger = LoggerFactory.getLogger(DemoController.class);
@RequestMapping("/bar")
// @ResponseBody
public String get() {
return null;
}
@PostMapping("/bar")
public String post() {
return null;
}
@PutMapping("/bar")
// @ResponseBody
public String put() {
return null;
}
@PatchMapping("/bar")
public String patch() {
return null;
}
@DeleteMapping("/bar")
// @ResponseBody
public void delete() {
}
}
#!/usr/bin/env bash
WORK_DIR=$(cd $(dirname $0);pwd)
set -e
export JAVA_HOME=~/.jenv/candidates/java/1.8.0_77/
alias mvn3=/home/admin/.jenv/candidates/maven/3.3.3/bin/mvn
shopt -s expand_aliases
if [ -f ${WORK_DIR}/sub_proj.txt ];then
while read sub_name
do
cd ${WORK_DIR}/${sub_name}
mvn3 deploy -Dmaven.test.skip=true -e
done < ${WORK_DIR}/sub_proj.txt
else
mvn3 deploy -Dmaven.test.skip=true -e
fi
\ No newline at end of file
#!/bin/bash
set -e
export JAVA_HOME=~/.jenv/candidates/java/1.8.0_77/
alias mvn3=/home/admin/.jenv/candidates/maven/3.3.3/bin/mvn
shopt -s expand_aliases
mvn3 clean package install -Dmaven.test.skip=true
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.yixi</groupId>
<artifactId>yixi-dependencies</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Project Dependencies</name>
<description>Project Dependencies</description>
<url>http://www.yixi001.com</url>
<organization>
<name>Yixi, Inc.</name>
<url>http://www.yixi001.com</url>
</organization>
<developers>
<developer>
<id>zhojing</id>
<name>赵静</name>
<email>zhaojing@ydl.com</email>
<organization>YDL, Inc.</organization>
<organizationUrl>http://www.ydl.com</organizationUrl>
<roles>
<role>Project Maintainer</role>
</roles>
</developer>
</developers>
<modules>
<module>checkstyle</module>
<module>yixi-parent</module>
</modules>
<properties>
<main.basedir>${basedir}/..</main.basedir>
<disable.checks>false</disable.checks>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.host.url>http://sonarqube.platform.k2.test.qipeng.info</sonar.host.url>
<!-- Define Third Dependencies Version -->
<junit.version>4.12</junit.version>
<assertj-core.version>3.7.0</assertj-core.version>
<mockito-core.version>2.13.0</mockito-core.version>
<hamcrest-library.version>1.3</hamcrest-library.version>
<javax-inject.version>1</javax-inject.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<persistence-api.version>1.0.2</persistence-api.version>
<commons-collections.version>3.2.2</commons-collections.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
<commons-codec.version>1.11</commons-codec.version>
<commons-pool.version>1.6</commons-pool.version>
<commons-io.version>2.6</commons-io.version>
<commons-fileupload.version>1.3.3</commons-fileupload.version>
<commons-lang3.version>3.7</commons-lang3.version>
<commons-collections4.version>4.1</commons-collections4.version>
<httpclient.version>4.5.4</httpclient.version>
<slf4j.version>1.7.25</slf4j.version>
<logback-classic.version>1.2.3</logback-classic.version>
<jackson.version>2.8.11</jackson.version>
<guava.version>21.0</guava.version>
<guice.version>4.1.0</guice.version>
<okhttp.version>3.9.1</okhttp.version>
<retrofit.version>2.3.0</retrofit.version>
<spring-boot.version>1.5.4.RELEASE</spring-boot.version>
<mybatis-starter.version>1.3.1</mybatis-starter.version>
<jooq.version>3.10.5</jooq.version>
<mongo-driver.version>3.12.8</mongo-driver.version>
<mysql.version>5.1.45</mysql.version>
<druid.version>1.1.6</druid.version>
<dubbo.version>2.5.3</dubbo.version>
<fastjson.version>1.2.44</fastjson.version>
<zkclient.version>0.10</zkclient.version>
<findbugs.version>3.0.2</findbugs.version>
<reactor-bom.version>Bismuth-SR4</reactor-bom.version>
<lombok.version>1.18.8</lombok.version>
<jmh.version>1.21</jmh.version>
<retrofit.converter.version>2.5.0</retrofit.converter.version>
<commons-compress.version>1.19</commons-compress.version>
<poi.version>4.1.0</poi.version>
<thyme.version>1.0.0-SNAPSHOT</thyme.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Generally Useful Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${hamcrest-library.version}</version>
<scope>test</scope>
</dependency>
<!--Thyme And Middleware Dependencies-->
<dependency>
<!-- Import dependency management from Thyme -->
<groupId>com.qipeng</groupId>
<artifactId>thyme-dependencies</artifactId>
<version>${thyme.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Import dependency management from Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Other Dependencies -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>${javax-inject.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>${persistence-api.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>${commons-pool.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
</dependency>
<!-- Import dependency management from Jackson -->
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-starter.version}</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>${jooq.version}</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-meta</artifactId>
<version>${jooq.version}</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen</artifactId>
<version>${jooq.version}</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>${mongo-driver.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>${zkclient.version}</version>
<exclusions>
<!-- 排除 logback 和 log4j 的冲突 -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>${findbugs.version}</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>${reactor-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-scalars</artifactId>
<version>${retrofit.converter.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.1</version>
</dependency>
<dependency>
<groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>sevntu-checkstyle-maven-plugin</artifactId>
<version>1.24.2</version>
</dependency>
<dependency>
<groupId>com.qipeng</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<!--
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.taovip.com/nexus/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>releases</id>
<url>http://nexus.taovip.com/nexus/content/repositories/releases</url>
</repository>
</distributionManagement>
-->
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.yixi</groupId>
<artifactId>yixi-dependencies</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>yixi-parent</artifactId>
<packaging>pom</packaging>
<name>Base Project Parent</name>
<description>Base Project Parent</description>
<dependencies>
<!-- Generally Useful Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>credit_checks.xml</configLocation>
<suppressionsLocation>credit_suppressions.xml</suppressionsLocation>
</configuration>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>validate</phase>
<configuration>
<skip>${disable.checks}</skip>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-rules</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8,)</version>
</requireJavaVersion>
<requireMavenVersion>
<version>[3.2.5,)</version>
</requireMavenVersion>
<requireProperty>
<property>main.basedir</property>
</requireProperty>
<requireProperty>
<property>project.name</property>
</requireProperty>
<requireProperty>
<property>project.description</property>
</requireProperty>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment