-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
133 lines (118 loc) · 3.45 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
group 'app.isparks'
version '0.0.1 beta'
description = "isparks for person"
buildscript {
ext{
springBootVersion = '2.6.6'
}
repositories {
mavenCentral()
google()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
}
// 版本统一管理
ext {
springVersion = '5.3.18'
lombokVersion = '1.18.12'
mybatisVersion = '3.5.5'
mybatisBootVersion = '2.1.3'
mybatisSpringVersion = '2.0.5'
pageHelperVersion = '5.2.0'
hikariCPVersion = '3.4.5'
h2DatabaseVersion = '1.4.200'
postgresqlJDBCVersion = '42.2.16'
shiroVersion = '1.5.3'
swaggerVersion = '2.9.2'
jwtVersion = '3.13.0'
jose4jVersion = '0.7.6'
javaxValidationVersion = '2.0.1.Final'
mapstructVersion = '1.3.1.Final'
yamlVersion = '1.26'
servletVersion = '4.0.1'
slf4jVersion = '1.7.30'
logbackVersion = '1.2.11'
logbackExpSpringVersion = '0.1.5'
pf4jVersion = '3.5.0'
commonsioVersion = '2.8.0'
gsonVersion = '2.8.6'
aspectjVersion = '1.9.6'
guavaVersion = '30.1.1-jre'
thymeleafVerson = '3.0.15.RELEASE'
}
/**
* All projects config
* 所有项目共享的配置
*/
allprojects {
repositories {
mavenCentral()
google()
}
apply plugin: 'idea'
//apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'checkstyle'
//jdk版本
sourceCompatibility = 1.8
targetCompatibility = 1.8
// 设置编译使用utf-8编码
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
// 依赖
dependencies {
// log
implementation "ch.qos.logback:logback-classic:$logbackVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "org.logback-extensions:logback-ext-spring:$logbackExpSpringVersion"
implementation "org.slf4j:jcl-over-slf4j:$slf4jVersion"
// test
testCompileOnly "org.springframework:spring-test:$springVersion"
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
}
tasks.withType(JavaCompile) {
// 编码格式
options.encoding = "UTF-8"
// 去除编译警告
options.compilerArgs << '-nowarn'
}
}
test {
useJUnitPlatform()
}
checkstyle {
toolVersion '6.11.1'
showViolations true
}
// config checkstyle
// 参考:https://blog.csdn.net/yuanjw2014/article/details/52851485/
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
configFile file("${project.projectDir}/config/checkstyle/checkstyle.xml")// Where my checkstyle config is...
//configProperties.checkstyleSuppressionsPath = file("${project.projectDirr}/config/quality/suppressions.xml").absolutePath // Where is my suppressions file for checkstyle is...
source 'src'
include '**/*.java'
exclude '**/gen/**'
exclude "**/test/**"
classpath = files()
}
subprojects {
dependencies {
// lombok
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
}