-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
320 lines (276 loc) · 11.2 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
plugins {
id "checkstyle"
id "java"
id "maven-publish"
id "idea"
id "eclipse"
id "jacoco"
id "org.springframework.boot"
id "com.google.cloud.tools.jib" version "3.4.2"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "org.openapi.generator" version "7.6.0"
id "com.github.node-gradle.node" version "7.0.2"
id "org.sonarqube" version "5.0.0.4638"
id "com.diffplug.spotless" version "6.25.0"
id "com.github.andygoossens.gradle-modernizer-plugin" version "1.9.2"
id "org.liquibase.gradle" version "2.2.2"
// this allows us to find outdated dependencies via ./gradlew dependencyUpdates
id "com.github.ben-manes.versions" version "0.51.0"
// jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
}
group = "de.tum.cit.ase"
version = "0.1.2"
description = ""
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
ext {
springProfiles = ""
if (project.hasProperty("tls")) {
springProfiles += ",tls"
}
if (project.hasProperty("e2e")) {
springProfiles += ",e2e"
}
}
apply from: "gradle/docker.gradle"
apply from: "gradle/sonar.gradle"
spotless {
java {
target 'src/*/java/**/*.java'
// removeUnusedImports()
}
}
apply from: "gradle/swagger.gradle"
apply from: "gradle/cache.gradle"
apply from: "gradle/liquibase.gradle"
// jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
if (project.hasProperty("prod") || project.hasProperty("gae")) {
apply from: "gradle/profile_prod.gradle"
} else {
apply from: "gradle/profile_dev.gradle"
}
if (project.hasProperty("war")) {
apply from: "gradle/war.gradle"
}
if (project.hasProperty("gae")) {
apply plugin: 'maven'
apply plugin: 'org.springframework.boot.experimental.thin-launcher'
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom "tech.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}"
}
}
appengineStage.dependsOn thinResolve
}
idea {
module {
excludeDirs += files("node_modules")
}
}
eclipse {
sourceSets {
main {
java {
srcDirs += ["build/generated/sources/annotationProcessor/java/main"]
}
}
}
}
defaultTasks "bootRun"
springBoot {
mainClass = "de.tum.cit.ase.ArtemisBenchmarkingApp"
}
test {
useJUnitPlatform()
exclude "**/*IT*", "**/*IntTest*"
testLogging {
events 'FAILED', 'SKIPPED'
}
jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx512m'
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.required = false
}
modernizer {
failOnViolations = true
includeTestClasses = true
}
check.dependsOn integrationTest
task testReport(type: TestReport) {
destinationDirectory = file("$buildDir/reports/tests")
testResults.from(test)
}
task integrationTestReport(type: TestReport) {
destinationDirectory = file("$buildDir/reports/tests")
testResults.from(integrationTest)
}
gitProperties {
failOnNoGitDirectory = false
keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
}
tasks.withType(com.gorylenko.GenerateGitPropertiesTask).configureEach {
outputs.doNotCacheIf("Task is always executed") { true }
}
checkstyle {
toolVersion "${checkstyleVersion}"
configFile file("checkstyle.xml")
checkstyleTest.enabled = false
maxErrors = 0
}
configurations {
providedRuntime
}
repositories {
// Local maven repository is required for libraries built locally with maven like development jhipster-bom.
// mavenLocal()
mavenCentral()
// jhipster-needle-gradle-repositories - JHipster will add additional repositories
}
dependencies {
// import JHipster dependencies BOM
if (!project.hasProperty("gae")) {
implementation platform("tech.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}")
}
// Use ", version: jhipsterDependenciesVersion, changing: true" if you want
// to use a SNAPSHOT release instead of a stable release
implementation "tech.jhipster:jhipster-framework"
implementation "jakarta.annotation:jakarta.annotation-api:3.0.0"
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate6"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
testImplementation "org.testcontainers:junit-jupiter:${testcontainersVersion}"
testImplementation "org.testcontainers:testcontainers:${testcontainersVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api"
implementation "com.zaxxer:HikariCP"
implementation "org.apache.commons:commons-lang3"
implementation "org.openapitools:jackson-databind-nullable:${jacksonDatabindNullableVersion}"
// Openapi generator uses javax namespace for now https://github.com/OpenAPITools/openapi-generator/pull/13593
implementation "javax.annotation:javax.annotation-api:1.3.2"
implementation "javax.validation:validation-api:2.0.1.Final"
annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernateVersion}"
implementation "org.hibernate.orm:hibernate-core"
implementation "org.hibernate.validator:hibernate-validator"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-loader-tools:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-cache:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-webflux:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
testImplementation "org.testcontainers:jdbc:${testcontainersVersion}"
implementation "org.springframework.boot:spring-boot-starter-logging:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-mail:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-security:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf:${springBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testImplementation "org.springframework.boot:spring-boot-test:${springBootVersion}"
testImplementation "org.springframework.security:spring-security-test:${springSecurityVersion}"
testImplementation("com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
testRuntimeOnly("com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude module: "spring-boot-starter-undertow"
}
implementation "org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-websocket:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server:${springBootVersion}"
implementation "org.springframework.security:spring-security-data:${springSecurityVersion}"
implementation "io.micrometer:micrometer-registry-prometheus:1.13.0"
implementation "io.dropwizard.metrics:metrics-core"
implementation "org.springframework.security:spring-security-messaging:${springSecurityVersion}"
implementation "commons-io:commons-io:2.16.1"
implementation "com.thedeanda:lorem:2.2"
implementation "org.eclipse.jgit:org.eclipse.jgit:6.9.0.202403050737-r"
implementation "io.reactivex.rxjava3:rxjava:3.1.8"
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.100.Final:osx-aarch_64'
implementation 'com.opencsv:opencsv:5.9'
}
if (project.hasProperty("gae")) {
task createPom {
def basePath = 'build/resources/main/META-INF/maven'
doLast {
pom {
withXml(dependencyManagement.pomConfigurer)
}.writeTo("${basePath}/${project.group}/${project.name}/pom.xml")
}
}
bootJar.dependsOn = [createPom]
}
task cleanResources(type: Delete) {
delete "build/resources"
}
wrapper {
gradleVersion = "8.7"
}
task webapp_test(type: NpmTask) {
inputs.property('appVersion', project.version)
inputs.files("package-lock.json")
.withPropertyName('package-lock')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("build.gradle")
.withPropertyName('build.gradle')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("angular.json")
.withPropertyName('angular.json')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("tsconfig.json", "tsconfig.app.json")
.withPropertyName("tsconfig")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("src/main/webapp/")
.withPropertyName("webapp-source-dir")
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir("build/test-results/jest/")
.withPropertyName("jest-result-dir")
outputs.file("build/test-results/TESTS-results-jest.xml")
.withPropertyName("jest-result")
outputs.file("build/test-results/clover.xml")
.withPropertyName("clover-result")
dependsOn npmInstall,compileTestJava
args = ["run", "webapp:test"]
}
if (project.hasProperty("nodeInstall")) {
node {
version = "20.10.0"
npmVersion = "10.2.4"
download = true
}
// Copy local node and npm to a fixed location for npmw
def fixedNode = tasks.register("fixedNode", Copy) {
from nodeSetup
into 'build/node'
}
tasks.named("nodeSetup").configure { finalizedBy fixedNode }
def fixedNpm = tasks.register("fixedNpm", Copy) {
from npmSetup
into 'build/node'
}
tasks.named("npmSetup").configure { finalizedBy fixedNpm }
}
test.dependsOn webapp_test
compileJava.dependsOn processResources
processResources.dependsOn bootBuildInfo
def isNonStable = { String version ->
def stableKeyword = ["RELEASE", "FINAL", "GA"].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
// Available commands:
//
// 1) Find dependency updates: ./gradlew dependencyUpdates -Drevision=release