Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
628 lines (508 loc) · 30.8 KB
/
Copy pathbuild.gradle
File metadata and controls
628 lines (508 loc) · 30.8 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
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:${spotless_plugin_version}"
// This is required so that the latest version of the liquibase gradle plugin works
classpath("org.liquibase:liquibase-core:${liquibase_version}") {
exclude group: "com.opencsv", module: "opencsv"
}
}
}
plugins {
id "checkstyle"
id "idea"
id "jacoco"
id "java"
id "com.adarshr.test-logger" version "4.0.0"
id "com.diffplug.spotless" version "${spotless_plugin_version}"
id "com.github.andygoossens.modernizer" version "${modernizer_plugin_version}"
id "com.github.ben-manes.versions" version "0.53.0"
id "com.github.node-gradle.node" version "${gradle_node_plugin_version}"
id "com.google.cloud.tools.jib" version "3.5.1"
id "com.gorylenko.gradle-git-properties" version "2.5.4"
id "io.spring.dependency-management" version "1.1.7"
id "nebula.lint" version "21.1.3"
id "org.liquibase.gradle" version "${liquibase_plugin_version}"
id "org.owasp.dependencycheck" version "12.1.9"
id "org.springframework.boot" version "${spring_boot_version}"
id "org.springdoc.openapi-gradle-plugin" version "1.9.0"
id "org.openapi.generator" version "7.17.0"
id "com.google.osdetector" version "1.7.3"
}
group = "de.tum.cit.aet.artemis"
version = "8.6.3"
description = "Interactive Learning with Individual Feedback"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
wrapper {
gradleVersion = "9.2.1"
}
node {
download = true
version = "${node_version}"
npmVersion = "${npm_version}"
}
apply from: "gradle/liquibase.gradle"
apply from: "gradle/spotless.gradle"
if (project.hasProperty("prod")) {
apply from: "gradle/profile_prod.gradle"
} else {
apply from: "gradle/profile_dev.gradle"
}
if (project.hasProperty("war")) {
apply from: "gradle/war.gradle"
}
idea {
module {
excludeDirs += files("node_modules")
}
}
defaultTasks "bootRun"
springBoot {
mainClass = "de.tum.cit.aet.artemis.ArtemisApp"
}
modernizer {
failOnViolations = false
includeTestClasses = true
// Copy the rule name as defined in https://github.com/gaul/modernizer-maven-plugin/blob/master/modernizer-maven-plugin/src/main/resources/modernizer.xml to exclude it
exclusions = ["java/util/Optional.get:()Ljava/lang/Object;"]
}
gitProperties {
// Only override branch when CI (= env variable present)
def ciBranch = System.getenv('GIT_BRANCH')
if (ciBranch) {
branch = ciBranch
}
// Optional: if you ever want to override commit from CI as well:
def ciCommit = System.getenv('GIT_COMMIT')
if (ciCommit) {
customProperty 'git.commit.id', ciCommit
customProperty 'git.commit.id.abbrev', ciCommit.take(7)
}
}
configurations {
mockitoAgent
}
repositories {
mavenCentral()
mavenLocal()
// required for org.gradle:gradle-tooling-api dependency
maven {
url = "https://repo.gradle.org/gradle/libs-releases"
}
// required for org.opensaml:* dependencies
maven {
url = "https://build.shibboleth.net/maven/releases"
}
}
configurations.configureEach {
exclude group: "org.dom4j", module: "dom4j"
exclude group: "org.xmlpull", module: "pull-parser"
exclude group: "jaxen", module: "jaxen"
exclude group: "xmlpull", module: "xpp3"
exclude group: "xsdlib", module: "xsdlib"
exclude group: "javax.xml.stream", module: "stax-api"
exclude group: "javax.xml.bind", module: "jaxb-api"
exclude group: "org.junit.vintage", module: "junit-vintage-engine"
exclude group: "junit", module: "junit"
exclude group: "com.vaadin.external.google", module: "android-json"
exclude group: "org.xmlunit", module: "xmlunit-core"
exclude group: "org.testcontainers", module: "mariadb"
exclude group: "org.testcontainers", module: "mssqlserver"
exclude group: "jakarta.ws.rs", module: "jsr311-api"
exclude group: "org.springframework.boot", module: "spring-boot-starter-undertow"
// these modules include security issues and are not needed
exclude group: "commons-jxpath", module: "commons-jxpath"
exclude group: "com.fasterxml.woodstox", module: "woodstox-core"
// those are transitive dependencies of JPlag Text --> Stanford NLP
// Note: we exclude them because they are not needed and might have security vulnerabilities
exclude group: "org.apache.lucene", module: "lucene-queryparser"
exclude group: "org.apache.lucene", module: "lucene-core"
exclude group: "org.apache.lucene", module: "lucene-analyzers-common"
exclude group: "org.jasypt", module: "jasypt"
// required by eureka client, but not used in this project
exclude group: "com.thoughtworks.xstream", module: "xstream"
// required by JPlag, but not used in this project
exclude group: "xerces", module: "xercesImpl"
// required by JPlag, but not used in this project
exclude group: "xalan", module: "xalan"
// required by JPlag, but not used in this project
exclude group: "xalan", module: "serializer"
exclude group: "org.springframework.boot", module: "spring-boot-starter-cache"
exclude group: "net.logstash.logback", module: "logstash-logback-encoder"
exclude group: "javax.cache", module: "cache-api"
exclude group: "javax.transaction", module: "javax.transaction-api"
// JPlag depends on those, but they are not really needed
exclude group: "org.jgrapht", module: "jgrapht-core"
exclude group: "org.apfloat", module: "apfloat"
exclude group: "xom", module: "xom"
exclude group: "commons-configuration", module: "commons-configuration"
}
dependencies {
// Required by Sharing Platform
implementation "org.codeability:SharingPluginPlatformAPI:1.2.1"
// Required by Spring cloud
implementation "org.apache.httpcomponents.client5:httpclient5:5.5.1"
implementation "org.apache.httpcomponents.core5:httpcore5:5.3.6"
implementation "org.apache.httpcomponents:httpmime:4.5.14"
implementation "jakarta.ws.rs:jakarta.ws.rs-api:4.0.0"
implementation "org.glassfish.jersey.core:jersey-common:4.0.0"
implementation "de.jplag:jplag:${jplag_version}"
implementation "de.jplag:c:${jplag_version}"
implementation "de.jplag:cpp:${jplag_version}"
implementation "de.jplag:csharp:${jplag_version}"
implementation "de.jplag:golang:${jplag_version}"
implementation "de.jplag:java:${jplag_version}"
implementation "de.jplag:javascript:${jplag_version}"
implementation "de.jplag:kotlin:${jplag_version}"
implementation "de.jplag:python-3:${jplag_version}"
implementation "de.jplag:rlang:${jplag_version}"
implementation "de.jplag:rust:${jplag_version}"
implementation "de.jplag:swift:${jplag_version}"
implementation "de.jplag:text:${jplag_version}"
implementation "de.jplag:typescript:${jplag_version}"
// Align all Spring AI modules to the same version
implementation platform("org.springframework.ai:spring-ai-bom:1.1.0")
// Azure OpenAI (prod, or when you want Azure)
implementation "org.springframework.ai:spring-ai-starter-model-azure-openai" // can also use non-azure models
implementation "org.springframework.ai:spring-ai-starter-model-chat-memory-repository-jdbc"
// OpenAI / OpenAI-compatible (dev, localhost:1234, etc.)
implementation "org.springframework.ai:spring-ai-starter-model-openai"
// we have to override those values to use the latest version
implementation "org.slf4j:jcl-over-slf4j:${slf4j_version}"
implementation "org.slf4j:jul-to-slf4j:${slf4j_version}"
implementation("org.slf4j:slf4j-api") {
version {
strictly "${slf4j_version}"
}
}
// Sentry depends on this
implementation "org.apache.logging.log4j:log4j-to-slf4j:2.25.2"
// Used for LTI (e.g. Moodle --> Artemis)
implementation "uk.ac.ox.ctl:spring-security-lti13:0.3.3"
// https://search.maven.org/artifact/org.eclipse.jgit/org.eclipse.jgit
implementation "org.eclipse.jgit:org.eclipse.jgit:${jgit_version}"
implementation "org.eclipse.jgit:org.eclipse.jgit.ssh.apache:${jgit_version}"
implementation "org.eclipse.jgit:org.eclipse.jgit.http.server:${jgit_version}"
implementation "org.eclipse.jgit:org.eclipse.jgit.archive:${jgit_version}"
// apache ssh enabled the ssh git operations in LocalVC together with JGit
implementation "org.apache.sshd:sshd-core:${sshd_version}"
implementation "org.apache.sshd:sshd-git:${sshd_version}"
implementation "org.apache.sshd:sshd-osgi:${sshd_version}"
implementation "org.apache.sshd:sshd-sftp:${sshd_version}"
// Allows generating UML diagrams from text descriptions in problem statement markdown files for programming exercises
implementation "net.sourceforge.plantuml:plantuml-mit:1.2025.10"
implementation "me.xdrop:fuzzywuzzy:1.4.0"
implementation("org.yaml:snakeyaml") {
version {
strictly "${snakeyaml_version}"
// needed to reduce the number of vulnerabilities, also see https://mvnrepository.com/artifact/org.yaml/snakeyaml
}
}
implementation "com.thoughtworks.qdox:qdox:2.2.0"
implementation "io.sentry:sentry-logback:${sentry_version}"
implementation "io.sentry:sentry-spring-boot-starter-jakarta:${sentry_version}"
// NOTE: the following dependencies use the newer versions explicitly to avoid other dependencies to use older versions
implementation "ch.qos.logback:logback-classic:${logback_version}"
implementation "ch.qos.logback:logback-core:${logback_version}"
// required by Saml2, should NOT be used in other places, we explicitly use the newest version to avoid security vulnerabilities
implementation "org.apache.santuario:xmlsec:4.0.4"
implementation "org.jsoup:jsoup:1.21.2"
// needed by e.g. spring security saml2, we explicitly use the newest version to avoid security vulnerabilities
implementation "commons-codec:commons-codec:1.20.0"
// use the latest version to avoid security vulnerabilities
implementation "org.springframework:spring-aop:${spring_framework_version}"
implementation "org.springframework:spring-aspects:${spring_framework_version}"
implementation "org.springframework:spring-beans:${spring_framework_version}"
implementation "org.springframework:spring-context:${spring_framework_version}"
implementation "org.springframework:spring-context-support:${spring_framework_version}"
implementation "org.springframework:spring-core:${spring_framework_version}"
implementation "org.springframework:spring-expression:${spring_framework_version}"
implementation "org.springframework:spring-jcl:${spring_framework_version}"
implementation "org.springframework:spring-jdbc:${spring_framework_version}"
implementation "org.springframework:spring-messaging:${spring_framework_version}"
implementation "org.springframework:spring-orm:${spring_framework_version}"
implementation "org.springframework:spring-tx:${spring_framework_version}"
implementation "org.springframework:spring-webmvc:${spring_framework_version}"
implementation "org.springframework:spring-web:${spring_framework_version}"
implementation "org.springframework:spring-websocket:${spring_framework_version}"
implementation "com.vdurmont:semver4j:3.1.0"
implementation "com.github.docker-java:docker-java-core:${docker_java_version}"
// Note: we explicitly use docker-java-transport-zerodep, because docker-java-transport-httpclient5 uses an outdated http5 version which is not compatible with Spring Boot >= 3.4.0
implementation "com.github.docker-java:docker-java-transport-zerodep:${docker_java_version}"
// use newest version of commons-compress to avoid security issues through outdated dependencies
implementation "org.apache.commons:commons-compress:1.28.0"
// required for monitoring with prometheus and grafana
implementation "io.micrometer:micrometer-registry-prometheus:${micrometer_version}"
implementation "io.micrometer:micrometer-core:${micrometer_version}"
implementation "io.micrometer:micrometer-commons:${micrometer_version}"
implementation "io.micrometer:micrometer-observation:${micrometer_version}"
implementation "io.micrometer:micrometer-jakarta9:${micrometer_version}"
// Prometheus requires the protobuf-java dependency, but we explicitly use the latest version to avoid security vulnerabilities
implementation "com.google.protobuf:protobuf-java:4.33.1"
implementation "tech.jhipster:jhipster-framework:${jhipster_dependencies_version}"
// Defines low-level streaming API, and includes JSON-specific implementations
implementation "com.fasterxml.jackson.core:jackson-core:${fasterxml_version}"
// Contains standard Jackson annotations
// TODO: use ${fasterxml_version} again when they release a new jackson-annotations version with correct semantic versioning
implementation "com.fasterxml.jackson.core:jackson-annotations:2.20"
// Implements data-binding (and object serialization) support
implementation "com.fasterxml.jackson.core:jackson-databind:${fasterxml_version}"
// Support for "Java 8 Dates"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${fasterxml_version}"
// Support JSON serialization and deserialization of Hibernate (https://hibernate.org) specific data types and properties; especially lazy-loading aspects
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate6:${fasterxml_version}"
// Support XML serialization and deserialization
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${fasterxml_version}"
// Support YML serialization and deserialization
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${fasterxml_version}"
// Avoid outdated version of netty to prevent security issues
implementation("io.netty:netty-buffer") { version { strictly netty_version } }
implementation("io.netty:netty-codec") { version { strictly netty_version } }
implementation("io.netty:netty-codec-dns") { version { strictly netty_version } }
implementation("io.netty:netty-codec-http") { version { strictly netty_version } }
implementation("io.netty:netty-codec-http2") { version { strictly netty_version } }
implementation("io.netty:netty-codec-socks") { version { strictly netty_version } }
implementation("io.netty:netty-common") { version { strictly netty_version } }
implementation("io.netty:netty-resolver") { version { strictly netty_version } }
implementation("io.netty:netty-resolver-dns") { version { strictly netty_version } }
implementation("io.netty:netty-transport") { version { strictly netty_version } }
implementation("io.netty:netty-transport-classes-epoll") { version {strictly netty_version } }
implementation("io.netty:netty-transport-native-epoll") { version { strictly netty_version } }
implementation("io.netty:netty-handler") { version { strictly netty_version } }
implementation("io.netty:netty-handler-proxy") { version { strictly netty_version } }
// only load netty-resolver-dns-native-macos on macos systems
if (osdetector.os == 'osx') {
def classifier = (osdetector.arch == 'aarch_64') ? 'osx-aarch_64' : 'osx-x86_64'
runtimeOnly("io.netty:netty-resolver-dns-native-macos:${netty_version}:${classifier}") { version { strictly netty_version } }
}
// Avoid outdated version of netty to prevent security issues
implementation("net.minidev:json-smart") { version {strictly "2.6.0" } }
// Required for synchronization between nodes and build agents (LocalCI)
implementation "com.hazelcast:hazelcast:${hazelcast_version}"
implementation "com.hazelcast:hazelcast-spring:${hazelcast_version}"
// Required for Hibernate multi node caching
runtimeOnly "com.hazelcast:hazelcast-hibernate53:5.2.0"
// alternative for Hazelcast
implementation "org.redisson:redisson:${redisson_version}"
implementation "org.redisson:redisson-spring-boot-starter:${redisson_version}"
implementation "org.hibernate.orm:hibernate-core:${hibernate_version}"
implementation "org.hibernate.orm:hibernate-envers:${hibernate_version}"
// Required for jdbc connection pooling to databases
implementation "com.zaxxer:HikariCP:7.0.2"
// Required for several dependencies
implementation "org.apache.commons:commons-text:${commons_text_version}"
implementation "org.apache.commons:commons-math3:3.6.1"
implementation "org.apache.commons:commons-lang3:${commons_lang3_version}"
implementation "org.apache.commons:commons-collections4:4.5.0"
// required by eureka, but actually superseded by commons-lang3 above
implementation "commons-lang:commons-lang:2.6"
implementation("org.liquibase:liquibase-core:${liquibase_version}") {
exclude group: "com.opencsv", module: "opencsv"
}
implementation "org.springframework.boot:spring-boot-starter-validation:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-loader-tools:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-mail:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-logging:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-aop:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-security:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-web:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-tomcat:${spring_boot_version}"
implementation "org.apache.tomcat.embed:tomcat-embed-core:${tomcat_version}"
implementation "org.apache.tomcat.embed:tomcat-embed-el:${tomcat_version}"
implementation "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcat_version}"
implementation "org.apache.tomcat:tomcat-annotations-api:${tomcat_version}"
implementation "org.springframework.boot:spring-boot-starter-websocket:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:${spring_boot_version}"
implementation "org.springframework.data:spring-data-jpa:3.5.6"
implementation "org.springframework.data:spring-data-ldap:3.5.6"
implementation "org.springframework.ldap:spring-ldap-core:3.3.4"
implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:${spring_cloud_version}"
implementation "org.springframework.cloud:spring-cloud-starter-config:${spring_cloud_version}"
implementation "org.springframework.cloud:spring-cloud-commons:${spring_cloud_version}"
// required by the Websocket Broker Connection in WebsocketConfiguration (due to multi node setup support)
// Note: this should be upgraded to 1.3.x when Spring is updated to 4.x
implementation "io.projectreactor.netty:reactor-netty-core:1.2.12"
// required for the connection to Hermes (push notifications)
implementation "org.springframework.retry:spring-retry:2.0.12"
// passkey functionality to simplify login
implementation "com.webauthn4j:webauthn4j-spring-security-core:0.11.2.RELEASE"
implementation "com.webauthn4j:webauthn4j-core:0.30.0.RELEASE"
implementation "org.springframework.security:spring-security-config:${spring_security_version}"
implementation "org.springframework.security:spring-security-data:${spring_security_version}"
implementation "org.springframework.security:spring-security-core:${spring_security_version}"
implementation "org.springframework.security:spring-security-oauth2-core:${spring_security_version}"
implementation "org.springframework.security:spring-security-oauth2-client:${spring_security_version}"
// use newest version of nimbus-jose-jwt to avoid security issues through outdated dependencies
implementation "com.nimbusds:nimbus-jose-jwt:10.6"
implementation "org.springframework.security:spring-security-oauth2-jose:${spring_security_version}"
implementation "org.springframework.security:spring-security-crypto:${spring_security_version}"
implementation "org.springframework.security:spring-security-web:${spring_security_version}"
implementation "org.springframework.security:spring-security-messaging:${spring_security_version}"
implementation "org.springframework.security:spring-security-ldap:${spring_security_version}"
// Nullable annotations for improved static analysis
implementation "org.jspecify:jspecify:1.0.0"
// Helios push-based status updates
implementation "de.tum.cit.aet:helios-status-spring-starter:${helios_status_version}"
implementation "org.opensaml:opensaml-saml-api:${opensaml_version}"
implementation "org.opensaml:opensaml-saml-impl:${opensaml_version}"
implementation "org.springframework.security:spring-security-saml2-service-provider:${spring_security_version}"
implementation "io.jsonwebtoken:jjwt-api:${jwt_version}"
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jwt_version}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jwt_version}"
// required by sshd-git
implementation "org.bouncycastle:bcpkix-jdk18on:1.83"
implementation "org.bouncycastle:bcprov-jdk18on:1.83"
implementation "com.mysql:mysql-connector-j:${mysql_version}"
implementation "org.postgresql:postgresql:42.7.8"
implementation "org.zalando:problem-spring-web:0.29.1"
implementation "org.zalando:jackson-datatype-problem:0.27.1"
// Required by JPlag
implementation "com.ibm.icu:icu4j-charset:78.1"
// Required by exam session service
implementation "com.github.seancfoley:ipaddress:5.5.1"
// used for testing and Java Template Upgrade Service
implementation "org.apache.maven:maven-model:3.9.11"
implementation "org.apache.pdfbox:pdfbox:3.0.6"
implementation "org.apache.commons:commons-csv:1.14.1"
implementation "org.commonmark:commonmark:0.27.0"
implementation "commons-fileupload:commons-fileupload:1.6.0"
implementation "net.lingala.zip4j:zip4j:2.11.5"
// use newest version of guava to avoid security issues through outdated dependencies
implementation "com.google.guava:guava:33.5.0-jre"
implementation "com.sun.activation:jakarta.activation:2.0.1"
// use newest version of gson to avoid security issues through outdated dependencies
// NOTE: gson itself is not allowed in the Artemis code (based on architecture tests), but is used by dependencies (e.g. spring cloud eureka netflix)
implementation "com.google.code.gson:gson:2.13.2"
// explicitly only use this at runtime (required by liquibase, because developers should prefer org.apache.commons:csv
runtimeOnly "com.opencsv:opencsv:5.12.0"
// make sure to use the latest version to avoid security vulnerabilities
runtimeOnly "commons-beanutils:commons-beanutils:1.11.0"
checkstyle "commons-beanutils:commons-beanutils:1.11.0"
checkstyle "org.apache.commons:commons-lang3:${commons_lang3_version}"
checkstyle "org.apache.commons:commons-text:${commons_text_version}"
implementation "com.google.errorprone:error_prone_annotations:2.45.0"
// needed for OpenAPI generation
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.14"
// NOTE: we want to keep the same unique version for all configurations, implementation and annotationProcessor
implementation("net.bytebuddy:byte-buddy") { version { strictly byte_buddy_version } }
annotationProcessor("net.bytebuddy:byte-buddy") { version { strictly byte_buddy_version } }
liquibaseRuntime("net.bytebuddy:byte-buddy") { version { strictly byte_buddy_version } }
implementation("net.bytebuddy:byte-buddy-agent") { version { strictly byte_buddy_version } }
annotationProcessor("net.bytebuddy:byte-buddy-agent") { version { strictly byte_buddy_version } }
annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernate_version}"
annotationProcessor "org.hibernate.orm:hibernate-core:${hibernate_version}"
annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}"
implementation "org.mnode.ical4j:ical4j:4.2.1"
// ---- CHECKSTYLE DEPENDENCIES ----
// use newest version of plexus to avoid security issues through outdated dependencies
checkstyle "org.codehaus.plexus:plexus-container-default:2.1.1"
checkstyle "org.codehaus.plexus:plexus-classworlds:2.9.0"
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyle_version}"
// ---- TEST DEPENDENCIES ----
testImplementation "org.springframework.boot:spring-boot-starter-test:${spring_boot_version}"
testImplementation "org.springframework.security:spring-security-test:${spring_security_version}"
testImplementation "org.springframework.boot:spring-boot-test:${spring_boot_version}"
testImplementation "org.springframework:spring-test:${spring_framework_version}"
testImplementation "org.assertj:assertj-core:3.27.6"
testImplementation "org.mockito:mockito-core:${mockito_version}"
// needed to add mockito as agent and avoid its warning
mockitoAgent ("org.mockito:mockito-core:${mockito_version}") {
transitive = false
}
testImplementation "org.mockito:mockito-junit-jupiter:${mockito_version}"
testImplementation "io.github.classgraph:classgraph:4.8.184"
testImplementation "org.awaitility:awaitility:4.3.0"
testImplementation "org.apache.maven.shared:maven-invoker:3.3.0"
testImplementation "org.gradle:gradle-tooling-api:9.2.1"
testImplementation "org.apache.maven.surefire:surefire-report-parser:3.5.4"
testImplementation "io.zonky.test:embedded-database-spring-test:2.7.1"
testImplementation "com.redis:testcontainers-redis:2.2.4"
testImplementation "com.tngtech.archunit:archunit:1.4.1"
testImplementation "org.skyscreamer:jsonassert:1.5.3"
// we only need the database present at runtime
runtimeOnly "com.h2database:h2:2.4.240"
// Lightweight JSON library needed for the internals of the MockRestServiceServer
testImplementation "org.json:json:20250517"
testImplementation "org.junit.jupiter:junit-jupiter:${junit_version}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_version}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit_version}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junit_version}"
// NOTE: make sure this corresponds to the version used for JUnit in the testImplementation
testImplementation "org.junit.platform:junit-platform-commons:${junit_version}"
testImplementation "org.junit.platform:junit-platform-engine:${junit_version}"
testImplementation "org.junit.platform:junit-platform-launcher:${junit_version}"
}
// we have to apply the test.gradle file after the dependencies block, otherwise we get the error Cannot change dependencies of dependency configuration ':mockitoAgent' after it has been resolved
apply from: "gradle/test.gradle"
apply from: "gradle/openapi.gradle"
dependencyManagement {
imports {
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:17.2.0"
}
}
tasks.register("cleanResources", Delete) {
delete "build/resources"
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:deprecation"
}
tasks.register("stage") {
dependsOn "bootWar"
}
// Set the npm cache (used in the Dockerfile)
tasks.register("npmSetCacheDockerfile", NpmTask) {
args = ["set", "cache", "/opt/artemis/.npm"]
}
// Command to execute the JavaDoc checkstyle verification ./gradlew checkstyleMain
checkstyle {
toolVersion = "${checkstyle_version}"
configFile = file("checkstyle.xml")
checkstyleTest.enabled = false
maxErrors = 0
}
gradleLint {
rules = ["dependency-parentheses"]
}
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) Build production: ./gradlew -Pprod -Pwar clean bootWar
// 2) Execute tests with coverage report: ./gradlew test jacocoTestReport -x webapp
// 2a) Execute tests without coverage report: ./gradlew test -x webapp
// 2b) Run a single test: ./gradlew test --tests ExamIntegrationTest -x webapp or ./gradlew test --tests ExamIntegrationTest.testGetExamScore -x webapp
// 2c) Run tests for modules: ./gradlew test -DincludeModules=athena,atlas -x webapp (executes all tests in directories ./src/main/test/.../athena and ./src/main/test/.../atlas) + ArchitectureTests
// 2d) Execute tests with Postgres container: SPRING_PROFILES_INCLUDE=postgres ./gradlew test -x webapp
// 2e) Execute tests with MySQL container: SPRING_PROFILES_INCLUDE=mysql ./gradlew test -x webapp
// 3) Verify code coverage (after tests): ./gradlew jacocoTestCoverageVerification -x webapp
// 4) Check Java code format: ./gradlew spotlessCheck -x webapp
// 5) Apply Java code formatter: ./gradlew spotlessApply -x webapp
// 6) Find dependency updates: ./gradlew dependencyUpdates -Drevision=release
// 7) Check JavaDoc: ./gradlew checkstyleMain -x webapp
// 8) Detects uses of legacy code: ./gradlew modernizer -x webapp
// 9) Check for vulnerabilities in dependencies ./gradlew dependencyCheckAnalyze -x webapp
// 10) Clear Liquibase checksums: ./gradlew liquibaseClearChecksums
// 11) Create changelog between Java and DB ./gradlew liquibaseDiffChangeLog (make sure to set the correct username and password in liquibase.gradle)
// 12) Generate initial schema from DB ./gradlew liquibaseGenerateChangelog (make sure to set the correct username and password in liquibase.gradle)
// 13) Find unused dependencies ./gradlew lintGradle -x webapp
// 14) Generate OpenAPI client services & DTOs: ./gradlew openApiGenerate -x webapp (only relevant for tutorial groups and hyperion at the moment)
// 15) Generate OpenAPI spec: ./gradlew generateApiDocs -x webapp (only relevant for tutorial groups and hyperion at the moment)