-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
103 lines (84 loc) · 3.15 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
plugins {
id 'idea'
id 'java'
id 'java-library'
}
// 所有模块/项目的通用配置
allprojects {
group = GROUP_ID
version = VERSION
apply plugin: 'maven-publish'
apply plugin: 'signing'
// 指定JDK版本
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
// 指定编码格式
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
// Java编译任务依赖处理资源的任务
compileJava.dependsOn(processResources)
//maven仓库
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/spring" }
maven { url "https://maven.aliyun.com/repository/spring-plugin" }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url "https://repo.spring.io/release" }
maven { url "https://repo.spring.io/milestone" }
mavenCentral()
}
}
configure(subprojects - project(":gear4j-bom")) {
apply plugin: "idea"
apply plugin: "java"
apply plugin: "java-library"
apply from: "${rootProject.projectDir}/gradle/publish.gradle"
ext {
springBootVersion = "2.6.9"
lombokVersion = "1.18.24"
}
// 子项目依赖,类似于在父maven的dependencies
dependencies {
// import BOM.
api platform(project(':gear4j-bom'))
compileOnly "jakarta.servlet:jakarta.servlet-api"
compileOnly "org.springframework.boot:spring-boot-starter-web"
compileOnly "com.baomidou:mybatis-plus-extension"
compileOnly "com.google.code.findbugs:jsr305"
compileOnly "io.swagger:swagger-annotations"
compileOnly "io.swagger.core.v3:swagger-annotations"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
testCompileOnly "com.google.code.findbugs:jsr305"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// lombok
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
}
configurations.all {
//移除org.json:json
exclude module: 'json'
exclude module: 'hutool-http'
//升级spring-beans 版本
// resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// if (details.requested.group == 'org.springframework:spring-beans') {
// details.useVersion '5.3.21'
// }
// }
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
}