-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
191 lines (173 loc) · 6.28 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
plugins {
id 'org.springframework.boot' version '2.7.18'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "io.freefair.lombok" version "6.6.3"
id 'maven-publish'
id 'signing'
id 'java-library'
id 'application'
id 'idea'
}
group = 'com.houkunlin'
version = '1.5.6'
description = """
系统数据字典自动翻译成字典文本。可集合系统数据库中存储的用户数据字典,也可使用枚举做系统数据字典,主要用在返回数据给前端时自动把字典值翻译成字典文本信息;
The system data dictionary is automatically translated into dictionary text.
The user data dictionary stored in the system database can be aggregated, and the enumeration can also be used as the system data dictionary.
It is mainly used to automatically translate dictionary values into dictionary text information when returning data to the front end.
"""
def gitRepo = "github.com/houkunlin-starter/system-dict-starter.git"
def isSnapshot = findProperty("snapshot") != null || version.endsWith('SNAPSHOT')
if (isSnapshot && !version.endsWith('SNAPSHOT')) {
version += '-BUILD-SNAPSHOT'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
maven { url 'https://repo.spring.io/release' }
mavenCentral()
}
dependencies {
compileOnly 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.springframework.boot:spring-boot-starter-data-redis'
testCompileOnly 'org.springframework.boot:spring-boot-starter-data-redis'
testImplementation 'org.springframework.boot:spring-boot-starter-data-redis'
// implementation 'org.redisson:redisson-spring-boot-starter:+'
compileOnly 'org.springframework.boot:spring-boot-starter-amqp'
// testImplementation 'org.springframework.boot:spring-boot-starter-amqp'
// https://mvnrepository.com/artifact/com.google.guava/guava
api 'com.google.guava:guava:33.0.0-jre'
api 'com.github.ben-manes.caffeine:caffeine'
api 'org.javassist:javassist:3.28.0-GA'
compileOnly 'javax.validation:validation-api:2.0.1.Final'
compileOnly 'jakarta.validation:jakarta.validation-api:3.0.2'
compileOnly 'io.swagger:swagger-annotations:1.6.6'
testImplementation 'io.swagger:swagger-annotations:1.6.6'
compileOnly 'io.swagger.core.v3:swagger-annotations:2.2.2'
testImplementation 'io.swagger.core.v3:swagger-annotations:2.2.2'
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
testAnnotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
publishing {
publications {
library(MavenPublication) {
from components.java
pom {
name = project.name
packaging = 'jar'
description = project.description
url = "https://${gitRepo}"
// properties = []
licenses {
license {
name = 'Mulan Permissive Software License,Version 2'
url = 'https://license.coscl.org.cn/MulanPSL2'
}
}
developers {
developer {
id = 'houkunlin'
name = 'HouKunLin'
email = '[email protected]'
}
}
scm {
connection = "scm:git://${gitRepo}"
developerConnection = "scm:git://${gitRepo}"
url = "git://${gitRepo}"
}
}
}
}
repositories {
maven {
name = "sonatype"
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("ossrhUsername")
password = findProperty("ossrhPassword") ?: System.getenv("ossrhPassword")
}
// 正式环境
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
// 非正式环境库
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
}
maven {
name = "buildDir"
String releasesRepoUrl = "$buildDir/repos/releases"
String snapshotsRepoUrl = "$buildDir/repos/snapshots"
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
// 使用 gradle.properties 设置参数,或者在命令行中增加 -Pgpg_private_key= -Pgpg_password= 设置参数
// 或者在环境变量中设置相应的环境变量
String signingKey = findProperty("gpg_private_key") ?: System.getenv("gpg_private_key")
if (signingKey != null) {
String signingPassword = findProperty("gpg_password") ?: System.getenv("gpg_password")
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications
// sign configurations.archives
}
bootJar {
enabled = false
}
bootStartScripts {
enabled = false
}
bootDistTar {
enabled = false
}
bootDistZip {
enabled = false
}
startScripts {
enabled = false
}
distTar {
enabled = false
}
distZip {
enabled = false
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
jar {
enabled = true
setArchiveClassifier("")
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
enabled = true
options.encoding = "UTF-8"
options.addStringOption('Xdoclint:none', '-quiet')
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
compileJava {
options.encoding = "UTF-8"
}
test {
useJUnitPlatform()
}