This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
168 lines (146 loc) · 4.92 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
buildscript {
dependencies {
// https://github.com/fabric8io-images/run-java-sh
// run-java.sh 是Java应用程序的通用启动脚本,特别是为从容器中运行而精心编制的。
// classpath("io.fabric8:run-java-sh:1.3.8")
classpath("org.ow2.asm:asm:9.1")
}
}
plugins {
id "io.spring.dependency-management" version "1.0.9.RELEASE"
id "com.github.hierynomus.license" version "0.15.0"
id "me.champeau.gradle.jmh" version "0.5.0"
id "org.flywaydb.flyway" version "7.3.1"
id "com.novoda.build-properties" version "0.4.1"
id "org.hidetake.ssh" version "2.10.1"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "com.bmuschko.docker-remote-api" version "6.7.0"
id "org.sonarqube" version "3.1.1"
id "com.google.protobuf" version "0.8.15"
}
flyway {
configFiles = ["${projectDir}/flyway.conf"]
}
dependencies {
// flywaydb 需要使用的依赖 https://flywaydb.org/
implementation("org.postgresql:postgresql")
}
allprojects {
apply plugin: "java"
apply plugin: "java-library"
apply plugin: "jacoco"
apply plugin: "checkstyle"
apply plugin: "com.google.protobuf"
apply plugin: "io.spring.dependency-management"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "me.champeau.gradle.jmh"
apply plugin: "com.github.hierynomus.license"
version = "1.0.0-SNAPSHOT"
sourceCompatibility = "11"
targetCompatibility = "11"
[compileJava, compileTestJava, javadoc]*.options*.encoding = "UTF-8"
test {
useJUnitPlatform()
testLogging {
exceptionFormat "full"
events "passed", "skipped", "failed"
}
workingDir rootProject.rootDir
}
jacoco {
toolVersion = "0.8.3"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
license {
header = rootProject.file("LICENSE")
headerURI = com.hierynomus.gradle.license.LicenseBasePlugin.classLoader.getResource("headers/Apache-2.0").toURI()
skipExistingHeaders = true
mapping {
java = "SLASHSTAR_STYLE"
conf = "SCRIPT_STYLE"
proto = "DOUBLESLASH_STYLE"
}
ext {
year = "2019-${Calendar.instance.get(Calendar.YEAR)}"
author = "the original author or authors"
}
}
checkstyle {
toolVersion = "8.33"
configFile = rootProject.file("config/checkstyle/google_checks.xml")
}
tasks.withType(Checkstyle) {
reports {
xml.enabled = true
html.enabled = true
}
}
sonarqube {
properties {
property "sonar.projectKey", "houge"
property "sonar.organization", "kevin70"
property "sonar.host.url", "https://sonarcloud.io"
}
}
dependencyManagement {
imports {
mavenBom("top.yein.chaos:chaos-bom:1.0-SNAPSHOT")
}
}
dependencies {
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.mapstruct:mapstruct-processor")
annotationProcessor("org.projectlombok:lombok-mapstruct-binding:0.2.0")
compileOnly("com.google.code.findbugs:jsr305")
compileOnly("org.apache.logging.log4j:log4j-api")
// Test
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
testImplementation("org.apache.logging.log4j:log4j-core")
testImplementation("org.apache.logging.log4j:log4j-slf4j-impl")
testImplementation("org.openjdk.jol:jol-core")
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation("com.github.stefanbirkner:system-lambda")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.projectreactor:reactor-tools")
testImplementation("io.micrometer:micrometer-test")
testImplementation("org.assertj:assertj-core")
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-inline")
testImplementation("org.powermock:powermock-reflect")
testImplementation("org.testcontainers:testcontainers")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("com.github.javafaker:javafaker") {
exclude module: "snakeyaml"
}
testImplementation("org.yaml:snakeyaml:1.27")
jmh("org.openjdk.jmh:jmh-core")
jmh("org.openjdk.jmh:jmh-generator-annprocess")
}
repositories {
mavenLocal()
def aliyunEnabled = System.getenv("GITHUB_ACTIONS") == null
if (aliyunEnabled) {
maven { url = "https://maven.aliyun.com/nexus/content/groups/public/" }
}
maven { url = "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
}
jar {
manifest {
attributes(
"Created-By": "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})",
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Built-Date": java.time.OffsetDateTime.now().truncatedTo(java.time.temporal.ChronoUnit.SECONDS)
)
}
}
}