This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
469 lines (380 loc) · 17.6 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
buildscript {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/release' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/repository/central' }
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' }
}
dependencies {
classpath 'io.github.fvarrui:javapackager:1.6.7'
}
}
plugins {
id 'eclipse'
id 'idea'
id 'java'
id 'war'
id 'application'
id 'maven-publish'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.2.2'
id 'org.openjfx.javafxplugin' version '0.0.13'
}
apply plugin: 'io.github.fvarrui.javapackager.plugin'
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
java {
compileJava.options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
compileJava.options.encoding = 'UTF-8'
withSourcesJar()
// withJavadocJar()
}
javadoc {
options.encoding = 'UTF-8'
}
javafx {
version = '17.0.2'
modules = [
'javafx.controls',
'javafx.fxml',
'javafx.graphics',
'javafx.media',
'javafx.web'
]
}
application {
mainClass = 'cc.xfl12345.mybigdata.server.web.MybigdataApplication'
}
run {
jvmArgs('-Dfile.encoding=UTF-8', '-Dapp.gui.enabled=true')
}
publishing {
publications {
maven(MavenPublication) {
// from components.java
artifact sourcesJar
artifact jar
artifact bootJar
artifact bootWar
// artifact war
}
}
}
group = 'cc.xfl12345.mybigdata'
version = '0.6.0'
sourceCompatibility = JavaVersion.VERSION_17
if (getProject().file('config.gradle').exists()) {
apply from: 'config.gradle'
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/release' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/repository/central' }
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' }
}
import java.nio.charset.StandardCharsets
dependencies {
// 补全环境,使得 Intelij IDEA 可以调试 build.gradle
// https://search.maven.org/artifact/org.apache.groovy/groovy-all/4.0.4/pom
testRuntimeOnly 'org.apache.groovy:groovy:4.0.7'
File localDevModeConfFile = getProject().file('localDevMode');
boolean isLocalDevMode = false;
if (localDevModeConfFile.exists()) {
FileReader fileReader = new FileReader(localDevModeConfFile, StandardCharsets.UTF_8);
BufferedReader bufferedReader = new BufferedReader(fileReader);
try {
String localDevMode = bufferedReader.readLine();
isLocalDevMode = 'true'.equals(localDevMode);
} catch (Exception ignored) {
} finally {
bufferedReader.close();
fileReader.close();
}
}
String parentModuleVersion = getProject().getVersion()
if (isLocalDevMode) {
implementation (group: 'cc.xfl12345.mybigdata', name: 'server-mysql-spring-boot-starter', version: parentModuleVersion)
// implementation group: 'cc.xfl12345.mybigdata', name: 'server-webdav', version: parentModuleVersion
// api group: 'cc.xfl12345.mybigdata', name: 'server-mysql-spring-boot-starter', version: depsParentVersion, ext: 'pom'
} else {
// https://jitpack.io/#xfl12345/java-mybigdata-server-mysql-spring-boot-starter
implementation group: 'com.github.xfl12345', name: 'java-mybigdata-server-mysql-spring-boot-starter', version: parentModuleVersion
// implementation group: 'com.github.xfl12345', name: 'java-mybigdata-server-mysql-spring-boot-starter', version: parentModuleVersion, ext: 'pom'
}
ArrayList<String> springBootDependencies = [
// 'starter-actuator',
// 'starter-thymeleaf',
'starter-web',
// 'starter-data-mongodb',
'starter-aop',
'starter-data-jdbc',
// 'starter-data-jpa',
// 'devtools',
'configuration-processor'
]
springBootDependencies.each {
moduleName ->
{
implementation group: 'org.springframework.boot', name: 'spring-boot-' + moduleName
// implementation group: 'org.springframework.boot', name: 'spring-boot-' + moduleName, ext: 'pom'
}
}
// implementation('org.springframework.boot:spring-boot-starter-web') {
// exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-core'
// exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-websocket'
// }
// implementation "org.apache.tomcat.experimental:tomcat-embed-programmatic:${dependencyManagement.importedProperties["tomcat.version"]}"
// // https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter
// implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: '3.1.4'
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'
String saTokenVersion = '1.33.0'
String hutoolVersion = '5.8.11'
String apacheCommonsVFS2Version = '2.9.0'
String apache_poi_version = '5.2.3'
// Sa-Token 框架
// https://mvnrepository.com/artifact/cn.dev33/sa-token-spring-boot-starter
implementation group: 'cn.dev33', name: 'sa-token-spring-boot-starter', version: saTokenVersion
implementation group: 'cn.dev33', name: 'sa-token-oauth2', version: saTokenVersion
// SpringDoc 框架
// https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.13'
// // Hawtio 框架
// // https://mvnrepository.com/artifact/io.hawt/hawtio-springboot
// implementation group: 'io.hawt', name: 'hawtio-springboot', version: '2.16.0'
// WebDAV 支持
// // https://mvnrepository.com/artifact/com.seanox/seanox-spring-webdav
// implementation( group: 'com.seanox', name: 'seanox-spring-webdav', version: '1.1.1') {
// exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
// }
//
// // https://mvnrepository.com/artifact/com.github.a-langer/webdav-vfs-gate
// implementation (group: 'com.github.a-langer', name: 'webdav-vfs-gate', version: '1.0.0', classifier: 'classes') {
// exclude group: 'ch.qos.logback'
// }
// https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
implementation group: 'org.fusesource.jansi', name: 'jansi', version: '2.4.0'
// // https://mvnrepository.com/artifact/org.beryx/text-io
// implementation group: 'org.beryx', name: 'text-io', version: '3.4.1'
// https://mvnrepository.com/artifact/org.apache.poi/poi
implementation group: 'org.apache.poi', name: 'poi', version: apache_poi_version
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-full
implementation group: 'org.apache.poi', name: 'poi-ooxml-full', version: apache_poi_version
// 注解神器 getter setter toString builder
// https://mvnrepository.com/artifact/org.projectlombok/lombok
implementation group: 'org.projectlombok', name: 'lombok'
annotationProcessor group: 'org.projectlombok', name: 'lombok'
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok'
testImplementation group: 'org.projectlombok', name: 'lombok'
// https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-annotations
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.7.3'
// https://mvnrepository.com/artifact/org.json/json
implementation group: 'org.json', name: 'json', version: '20220924'
// JSON Schema support
// https://mvnrepository.com/artifact/com.github.victools/jsonschema-generator
implementation group: 'com.github.victools', name: 'jsonschema-generator', version: '4.28.0'
// https://github.com/jimblackler/jsonschemafriend
// https://jitpack.io/#net.jimblackler/jsonschemafriend
// implementation 'net.jimblackler.jsonschemafriend:core:0.11.3'
// https://mvnrepository.com/artifact/com.networknt/json-schema-validator
implementation group: 'com.networknt', name: 'json-schema-validator', version: '1.0.75'
// Ant support
// https://mvnrepository.com/artifact/org.apache.ant/ant
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.12'
// Apache commons
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
// // https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2
// implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.8.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
// https://mvnrepository.com/artifact/org.apache.commons/commons-pool2
implementation group: 'org.apache.commons', name: 'commons-pool2', version: '2.11.1'
// https://mvnrepository.com/artifact/org.apache.commons/commons-crypto
implementation group: 'org.apache.commons', name: 'commons-crypto', version: '1.1.0'
// https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.1.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2
implementation group: 'org.apache.commons', name: 'commons-vfs2', version: apacheCommonsVFS2Version
// // https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2-jackrabbit1
// implementation group: 'org.apache.commons', name: 'commons-vfs2-jackrabbit1', version: apacheCommonsVFS2Version
// // implementation group: 'org.apache.commons', name: 'commons-vfs2-jackrabbit1', version: apacheCommonsVFS2Version, ext: 'pom'
//
// // https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2-jackrabbit2
// implementation group: 'org.apache.commons', name: 'commons-vfs2-jackrabbit2', version: apacheCommonsVFS2Version
// https://mvnrepository.com/artifact/commons-net/commons-net
implementation group: 'commons-net', name: 'commons-net', version: '3.8.0'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.14'
// https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.4'
// // https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient
// implementation group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
// // https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils
// implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
// https://mvnrepository.com/artifact/org.apache.tika/tika-core
implementation group: 'org.apache.tika', name: 'tika-core', version: '2.4.1'
// SSH support (For apache VFS sftp)
// https://search.maven.org/artifact/com.jcraft/jsch/0.1.55/jar
implementation 'com.jcraft:jsch:0.1.55'
// XML support
// https://mvnrepository.com/artifact/org.jsoup/jsoup
implementation group: 'org.jsoup', name: 'jsoup', version: '1.15.3'
// // https://mvnrepository.com/artifact/org.dom4j/dom4j
// implementation group: 'org.dom4j', name: 'dom4j', version: '2.1.3'
// // https://mvnrepository.com/artifact/com.j2html/j2html
// implementation group: 'com.j2html', name: 'j2html', version: '1.4.0'
// def javaMailVersion = '1.6.2'
// // Java Email support
// // https://mvnrepository.com/artifact/com.sun.mail/javax.mail
// implementation group: 'com.sun.mail', name: 'javax.mail', version: javaMailVersion
//
// // https://mvnrepository.com/artifact/javax.mail/javax.mail-api
// implementation group: 'javax.mail', name: 'javax.mail-api', version: javaMailVersion
// // 大名鼎鼎的 Java字节码操作框架 ASM
// // https://mvnrepository.com/artifact/org.ow2.asm/asm
// implementation group: 'org.ow2.asm', name: 'asm', version: asmVersion
//
// // https://mvnrepository.com/artifact/org.ow2.asm/asm-commons
// implementation group: 'org.ow2.asm', name: 'asm-commons', version: asmVersion
//
// // https://mvnrepository.com/artifact/org.ow2.asm/asm-util
// implementation group: 'org.ow2.asm', name: 'asm-util', version: asmVersion
// // 大名鼎鼎的 Java字节码工具 javassist
// // https://mvnrepository.com/artifact/org.javassist/javassist
// implementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
// // https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy
// implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.12.10'
//
// // https://mvnrepository.com/artifact/org.jsonschema2pojo/jsonschema2pojo
// implementation group: 'org.jsonschema2pojo', name: 'jsonschema2pojo-core', version: '1.1.2'
// Google Open Source Library
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10'
// ECC 加解密
// https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15to18
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk15to18', version: '1.72'
// HuTool 超级工具集
// https://mvnrepository.com/artifact/cn.hutool/hutool-core
implementation group: 'cn.hutool', name: 'hutool-core', version: hutoolVersion
implementation fileTree(dir:'lib',includes:['**/*.*'])
// implementation fileTree(dir:'src/main/webapp',includes:['**/*.*'])
// testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api'
// testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine'
testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test') {
exclude group: 'com.vaadin.external.google', module: 'android-json'
}
// providedRuntime(group: 'org.springframework.boot', name: 'spring-boot-starter-test') {
// exclude group: 'com.vaadin.external.google', module: 'android-json'
// }
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.named('bootJar') {
doLast {
File applicationProperties = getProject().file('config/application.properties');
if (applicationProperties.exists()) {
String destDirPath = 'build/libs/';
File configDir = getProject().file(destDirPath);
if (!configDir.exists()) {
configDir.mkdirs();
}
copy {
from applicationProperties.toPath()
into getProject().file(destDirPath).toPath()
}
}
}
}
// task.named('run') {
//
// }
import io.github.fvarrui.javapackager.model.SetupMode
import io.github.fvarrui.javapackager.gradle.PackageTask
task package2ConsoleApp(type: PackageTask, dependsOn: bootJar) {
// mandatory
// mainClass = 'cc.xfl12345.mybigdata.server.web.gui.Main'
mainClass = 'cc.xfl12345.mybigdata.server.web.MybigdataApplication'
// mainClass = 'org.springframework.boot.loader.JarLauncher'
// optional
bundleJre = true
customizedJre = false
generateInstaller = false
administratorRequired = false
platform = io.github.fvarrui.javapackager.model.Platform.auto
organizationName = 'xfl12345.cc'
organizationUrl = 'mybigdata.xfl12345.cc'
vmArgs = ['-Dfile.encoding=UTF-8', '-Dapp.gui.enabled=false']
// linuxConfig {
// }
// macConfig {
// }
winConfig {
headerType = 'console'
fileVersion = getProject().version
productVersion = getProject().version
setupMode = SetupMode.askTheUser
disableDirPage = false
disableProgramGroupPage = false
disableFinishedPage = false
disableWelcomePage = false
createDesktopIconTask = true
}
}
task package2GuiApp(type: PackageTask, dependsOn: bootJar) {
// mandatory
// mainClass = 'cc.xfl12345.mybigdata.server.web.gui.Main'
mainClass = 'cc.xfl12345.mybigdata.server.web.MybigdataApplication'
// mainClass = 'org.springframework.boot.loader.JarLauncher'
// optional
bundleJre = true
customizedJre = false
generateInstaller = false
administratorRequired = false
platform = io.github.fvarrui.javapackager.model.Platform.auto
organizationName = 'xfl12345.cc'
organizationUrl = 'mybigdata.xfl12345.cc'
vmArgs = ['-Dfile.encoding=UTF-8', '-Dapp.gui.enabled=true']
// linuxConfig {
// }
// macConfig {
// }
winConfig {
headerType = 'gui'
fileVersion = getProject().version
productVersion = getProject().version
setupMode = SetupMode.askTheUser
disableDirPage = false
disableProgramGroupPage = false
disableFinishedPage = false
disableWelcomePage = false
createDesktopIconTask = true
}
}