-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathbuild.gradle
129 lines (101 loc) · 3.62 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
//file:noinspection DependencyNotationArgument
//file:noinspection GrUnresolvedAccess
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/public" }
mavenCentral()
}
dependencies {
}
}
plugins {
id 'idea'
id 'java'
id 'org.springframework.boot' version '3.2.1' apply false
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'com.github.ben-manes.versions' version '0.50.0'
id "com.gorylenko.gradle-git-properties" version "2.4.1" apply false
}
apply from: 'build-lib.gradle'
allprojects {
repositories {
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/public" }
mavenCentral()
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
subprojects { subproj ->
// 父级目录不作为项目模块
def isSkipModule = ['modules', 'core', 'extra', 'shared'].contains(subproj.name)
if (isSkipModule) {
println("📛skip ${subproj.name}")
return
}
apply from: "${rootDir}/build-ext.gradle"
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
sourceCompatibility = '17'
// 重命名 jar 包,格式为:项目名-模块名-子模块名-版本号.jar
archivesBaseName = subproj.path.replace(':modules:', rootProject.name + '-').replace(':', '-')
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
// 兼容 jetbrains annotations,只在编译期有效
compileOnly 'org.jetbrains:annotations:24.1.0'
implementation libraries.'logback-classic'
implementation libraries.'jcl-over-slf4j'
implementation libraries.'log4j-over-slf4j'
implementation libraries.'commons-lang3'
implementation libraries.'commons-io'
implementation libraries.'commons-codec'
implementation libraries.'commons-beanutils-core'
implementation libraries.'spring-boot-starter-validation'
implementation libraries.'spring-boot-starter-web'
implementation libraries.'spring-boot-starter-cache'
implementation libraries.'spring-boot-starter-thymeleaf'
implementation libraries.'spring-boot-starter-actuator'
developmentOnly libraries.'spring-boot-devtools'
runtimeOnly libraries.'postgresql'
runtimeOnly libraries.'HikariCP'
// springdoc begin
implementation libraries.'springdoc-openapi-ui'
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
// Runtime library
implementation 'com.github.therapi:therapi-runtime-javadoc:0.15.0'
// springdoc end
// test
testImplementation libraries.'junit'
testImplementation libraries.'assertj'
testImplementation libraries.'awaitility'
testImplementation libraries.'greenmail'
testImplementation libraries.'greenmail-junit5'
testImplementation libraries.'spring-boot-starter-test'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
}
if (!subproj.name.startsWith('application')) {
// 不打成 Spring Boot 格式的 jar 包
jar {
enabled = true
}
bootJar {
enabled = false
}
}
tasks.named('test') {
useJUnitPlatform()
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}