build.gradle
4.79 KB
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
132
133
plugins {
id 'java'
id 'idea'
id 'application'
id 'org.springframework.boot' version '2.5.12'
id 'io.spring.dependency-management' version '1.1.6'
id 'com.google.protobuf' version '0.9.4'
}
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
mavenLocal()
mavenCentral()
}
application {
mainClassName = 'com.infoloop.tianting.App'
applicationDefaultJvmArgs = [
'-Denv.propertiesFilePath=file:application.properties',
'-Dlogging.path=logs']
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
ext {
grpcVersion = '1.62.2'
protobufVersion = '3.25.3'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator' //监视和管理
implementation 'org.springframework.boot:spring-boot-starter-validation' //参数校验
implementation 'org.springframework.boot:spring-boot-starter-aop' //aop
implementation 'org.springframework.retry:spring-retry' //retry
implementation 'com.github.xiaoymin:knife4j-spring-boot-starter:2.0.9'//knife4j
implementation 'cn.dev33:sa-token-spring-boot-starter:1.38.0' //saToken
implementation 'cn.dev33:sa-token-redis-jackson:1.38.0' // Sa-Token 整合 Redis (jackson 序列化)
implementation 'cn.dev33:sa-token-jwt:1.38.0'// Sa-Token 整合 jwt
implementation 'org.apache.commons:commons-pool2' //Lettuce 对象池
implementation 'io.lettuce:lettuce-core:6.0.0.RC2'// Lettuce
implementation 'org.redisson:redisson:3.27.2'// redisson分布式锁
implementation 'com.squareup.okhttp3:okhttp' //okhttp3
implementation "org.apache.poi:poi:4.1.2" //poi
implementation "org.apache.poi:poi-ooxml:4.1.2" //poi
implementation 'cn.hutool:hutool-all:5.8.27' //huTool-util
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.2' // Jackson XML 模块
implementation 'org.springframework.boot:spring-boot-starter-websocket'// websocket
// 缓存相关依赖
implementation 'org.springframework.boot:spring-boot-starter-data-redis' // Redis
implementation 'org.apache.commons:commons-pool2' // Redis连接池(增强版)
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8' // Caffeine本地缓存
implementation 'org.springframework:spring-aspects' // Spring AOP
implementation 'io.micrometer:micrometer-core:1.14.2' // 监控指标
implementation 'io.micrometer:micrometer-registry-statsd:1.14.2' // StatsD监控
implementation 'com.aliyun:aliyun-java-sdk-core:4.6.4' //阿里云SDK核心库
implementation 'com.aliyun:aliyun-java-sdk-dysmsapi:2.2.1'//阿里云短信服务SDK
implementation 'com.aliyun:aliyun-java-sdk-dm:3.3.2'//阿里云邮件服务SDK
implementation "com.aliyun.oss:aliyun-sdk-oss:3.11.1"//阿里云OSS服务
implementation "io.zipkin.brave:brave:5.12.5"
implementation "io.zipkin.brave:brave-context-slf4j:5.12.5"
implementation "io.zipkin.reporter2:zipkin-sender-urlconnection:2.15.1"
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
// compileOnly 'org.projectlombok:lombok'
// annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
grpc {}
}
}
}
}
tasks.withType(JavaCompile).configureEach {
it.options.incremental = true
it.options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation"]
it.options.forkOptions.jvmArgs = ['-Xmx2g', '-XX:MaxMetaspaceSize=512m']
it.options.encoding = "UTF-8"
it.options.fork = true
}
tasks {
compileJava {
dependsOn generateProto
source fileTree('build/generated/source/proto/main/java')
}
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
srcDirs 'build/generated/sources/annotationProcessor/java/main'
srcDirs 'build/generated/sources/headers/java/main'
}
}
}
test {
enabled = false
useJUnitPlatform()
}