forked from ls1intum/Artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
663 lines (547 loc) · 33 KB
/
Copy pathbuild.gradle
File metadata and controls
663 lines (547 loc) · 33 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
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
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.54.0"
id "com.github.node-gradle.node" version "${gradle_node_plugin_version}"
id "com.google.cloud.tools.jib" version "3.5.3"
id "com.gorylenko.gradle-git-properties" version "2.5.7"
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.2.1"
id "org.springframework.boot" version "${spring_boot_version}"
id "org.springdoc.openapi-gradle-plugin" version "1.9.0"
id "org.openapi.generator" version "7.21.0"
id "com.google.osdetector" version "1.7.3"
id "org.cyclonedx.bom" version "3.2.4"
}
// Load Docker image versions from .env (single source of truth for Docker, tests, and build dependencies)
apply from: 'gradle/env.gradle'
envProperties.each { key, value ->
// Convert UPPER_CASE to lower_case to match gradle.properties convention
ext.set(key.toLowerCase(), value)
}
group = "de.tum.cit.aet.artemis"
version = "9.1.2"
description = "Interactive Learning with Individual Feedback"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
wrapper {
gradleVersion = "9.4.1"
}
node {
download = true
version = "${node_version}"
npmVersion = "${npm_version}"
}
apply from: "gradle/liquibase.gradle"
apply from: "gradle/spotless.gradle"
apply from: "gradle/sbom.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"
}
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)
}
}
// Override Spring Boot BOM versions to patched releases addressing known CVEs
// thymeleaf 3.1.4.RELEASE: GHSA-7rgv-g3jm-rvv4, GHSA-vjp2-6m4m-cv5q
// tomcat 11.0.21: GHSA-h9fx-5mv3-gmh6, GHSA-6q54-28g2-vpgm, GHSA-55j7-cm8x-wvmh
ext["thymeleaf.version"] = "3.1.4.RELEASE"
ext["tomcat.version"] = "11.0.21"
configurations {
mockitoAgent
}
repositories {
mavenCentral()
mavenLocal()
// required for Spring AI milestone releases
maven {
url = "https://repo.spring.io/milestone"
}
// 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: "org.testcontainers", module: "testcontainers-mariadb"
exclude group: "org.testcontainers", module: "testcontainers-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"
// we do not really use kotlin libraries, exclude to avoid conflicts and security vulnerabilities
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib"
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk8"
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-common"
exclude group: "org.springframework.boot", module: "spring-boot-starter-cache"
exclude group: "net.logstash.logback", module: "logstash-logback-encoder"
// javax.cache:cache-api is now needed for hibernate-jcache L2 cache bridge
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"
// the following two outdated commons libraries should not be used anymore due to security vulnerabilities
// there are newer versions available: commons-configuration2 and commons-lang3 which are actively maintained
exclude group: "commons-configuration", module: "commons-configuration"
exclude group: "commons-lang", module: "commons-lang"
}
dependencies {
// Required by Sharing Platform
implementation "org.codeability:SharingPluginPlatformAPI:1.2.1"
// Required by Spring cloud
// Cannot org.apache.httpcomponents to later version due to compatibility issues
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.2"
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:2.0.0-M4")
// 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"
// Override transitive dependencies from spring-ai to fix security vulnerabilities
// jackson-bom 3.1.1 fixes GHSA-2m67-wjpj-xhg9 (document length constraint bypass)
implementation "tools.jackson.core:jackson-core:3.1.2"
implementation "tools.jackson.core:jackson-databind:3.1.2"
constraints {
implementation("io.modelcontextprotocol.sdk:mcp-core:1.1.1") {
because("Fix GHSA-hv2w-8mjj-jw22: hardcoded wildcard CORS")
}
}
// 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.4"
// Used for LTI (e.g. Moodle --> Artemis)
implementation("uk.ac.ox.ctl:spring-security-lti13:0.3.4") {
// Exclude jakartaee-api:10 which contains old jakarta.persistence 3.1 classes that conflict with 3.2 required by Hibernate 7
exclude group: "jakarta.platform", module: "jakarta.jakartaee-api"
}
// 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.2026.2"
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}"
// Use sentry-spring-boot-4-starter for Spring Boot 4 compatibility (replaces sentry-spring-boot-starter-jakarta)
implementation "io.sentry:sentry-spring-boot-4-starter:${sentry_version}"
implementation "ch.qos.logback:logback-classic"
implementation "ch.qos.logback:logback-core"
// 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.22.2"
// needed by e.g. spring security saml2, we explicitly use the newest version to avoid security vulnerabilities
implementation "commons-codec:commons-codec:1.21.0"
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 (versions managed by Spring Boot BOM)
implementation "io.micrometer:micrometer-registry-prometheus"
implementation "io.micrometer:micrometer-core"
implementation "io.micrometer:micrometer-commons"
implementation "io.micrometer:micrometer-observation"
// required for exposing LLM traces to Langfuse (version managed by Spring Boot BOM)
implementation "io.micrometer:micrometer-tracing-bridge-otel"
// OpenTelemetry version managed by the micrometer-tracing BOM
implementation "io.opentelemetry:opentelemetry-exporter-otlp"
// Prometheus requires the protobuf-java dependency, but we explicitly use the latest version to avoid security vulnerabilities
implementation "com.google.protobuf:protobuf-java:4.34.1"
// Jackson 2 core modules — versions managed by Spring Boot BOM
implementation "com.fasterxml.jackson.core:jackson-annotations"
implementation "com.fasterxml.jackson.core:jackson-core"
implementation "com.fasterxml.jackson.core:jackson-databind"
// Java Time (JSR310) support for Jackson
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
// Support JSON serialization and deserialization of Hibernate specific data types and properties; especially lazy-loading aspects
// Use hibernate7 variant for Hibernate 7.x compatibility
// NOTE: version pinned because the Spring Boot BOM does not include the hibernate7 variant.
// Must be kept in sync with the Jackson 2.x version managed by the BOM.
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate7:2.21.2"
// Support XML serialization and deserialization
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml"
// Support YML serialization and deserialization
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"
// Avoid outdated version of json-smart to prevent security issues, we only use this as transitive dependency for third party dependencies
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 via JCache bridge (hazelcast-hibernate53 is incompatible with Hibernate 7).
// Pinned one minor ahead of the Spring Boot 4.0.5 BOM (7.2.7) to pick up HHH-20209 (race in JavaTypeRegistry
// during parallel UNION queries) and HHH-20231 (2L-cached native queries with same SQL but different result
// type). Drop this override once Spring Boot's BOM catches up to 7.2.12+.
implementation "org.hibernate.orm:hibernate-jcache:7.2.12.Final"
implementation "javax.cache:cache-api:1.1.1"
// alternative for Hazelcast
implementation "org.redisson:redisson:${redisson_version}"
implementation "org.redisson:redisson-spring-boot-starter:${redisson_version}"
// Hibernate ORM — pinned to 7.2.12.Final (patch bumps over the 7.2.7 shipped by Spring Boot 4.0.5 BOM).
// See the note on hibernate-jcache above for the rationale; keep all four artifacts in lockstep.
implementation "org.hibernate.orm:hibernate-core:7.2.12.Final"
implementation "org.hibernate.orm:hibernate-envers:7.2.12.Final"
// 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"
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-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-liquibase:${spring_boot_version}"
// Renamed from spring-boot-starter-aop in Spring Boot 4
implementation "org.springframework.boot:spring-boot-starter-aspectj:${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-http-converter:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-tomcat:${spring_boot_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}"
// Spring Data and LDAP — versions managed by the Spring Boot BOM.
implementation "org.springframework.data:spring-data-jpa"
implementation "org.springframework.data:spring-data-ldap"
implementation "org.springframework.ldap:spring-ldap-core"
// Spring Cloud 2025.1.1 (Oakwood) — individual module version is 5.0.1. Kept explicit because the
// spring-cloud-dependencies BOM does not publish versions for these specific modules.
implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:5.0.1"
implementation "org.springframework.cloud:spring-cloud-starter-config:5.0.1"
implementation "org.springframework.cloud:spring-cloud-commons:5.0.1"
// required by the Websocket Broker Connection in WebsocketConfiguration (due to multi node setup support).
// Version managed by the Spring Boot BOM.
implementation "io.projectreactor.netty:reactor-netty-core"
// required for the connection to Hermes (push notifications)
implementation "org.springframework.retry:spring-retry:2.0.12"
// passkey functionality to simplify login — Spring Security versions managed by the Spring Boot BOM.
implementation "org.springframework.security:spring-security-webauthn"
implementation "com.webauthn4j:webauthn4j-spring-security-core:0.12.0.RELEASE"
implementation "com.webauthn4j:webauthn4j-core:0.31.3.RELEASE"
implementation "org.springframework.security:spring-security-messaging"
implementation "org.springframework.security:spring-security-ldap"
// use newest version of nimbus-jose-jwt to avoid security issues through outdated dependencies
implementation "com.nimbusds:nimbus-jose-jwt:10.9"
// 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 "com.bucket4j:bucket4j_jdk17:${bucket4j_version}"
implementation "com.bucket4j:bucket4j_jdk17-hazelcast:${bucket4j_version}"
// Weaviate vector database client for semantic search
implementation "io.weaviate:client6:${weaviate_client_version}"
constraints {
implementation("com.google.code.gson:gson:2.13.2") {
because("Required by Weaviate client v6 for JSON serialization")
}
}
implementation "org.opensaml:opensaml-saml-api:${opensaml_version}"
implementation "org.opensaml:opensaml-saml-impl:${opensaml_version}"
// Spring Boot 4 moved SAML2 autoconfiguration out of spring-boot-autoconfigure into this dedicated starter.
// It transitively brings spring-security-saml2-service-provider and registers the
// RelyingPartyRegistrationRepository bean from spring.security.saml2.relyingparty.* properties.
implementation "org.springframework.boot:spring-boot-starter-security-saml2"
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; 1.84 fixes GHSA-4jwv-qpf8-5w8v, GHSA-6w4m-2xhg-2658, GHSA-fwcp-hj66-p6g3
implementation "org.bouncycastle:bcpkix-jdk18on:1.84"
implementation "org.bouncycastle:bcprov-jdk18on:1.84"
// pulled transitively by sshd-git; pin to patched version
implementation "org.bouncycastle:bcpg-jdk18on:1.84"
// required for database connections
implementation "com.mysql:mysql-connector-j:${mysql_connector_version}"
implementation "org.postgresql:postgresql:42.7.10"
// Required by JPlag
implementation "com.ibm.icu:icu4j-charset:78.3"
// Required by exam session service
implementation "com.github.seancfoley:ipaddress:5.6.2"
// used for testing and Java Template Upgrade Service
implementation "org.apache.maven:maven-model:4.0.0-rc-5"
implementation "org.apache.pdfbox:pdfbox:3.0.7"
implementation "org.apache.commons:commons-csv:1.14.1"
implementation "org.commonmark:commonmark:0.28.0"
implementation "commons-fileupload:commons-fileupload:1.6.0"
implementation "net.lingala.zip4j:zip4j:2.11.6"
// use newest version of guava to avoid security issues through outdated dependencies
implementation "com.google.guava:guava:33.5.0-jre"
// 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.49.0"
// needed for OpenAPI generation (v3 required for Spring Boot 4)
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.3"
// 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 } }
// Hibernate annotation processors — kept in lockstep with hibernate-core/envers/jcache above.
annotationProcessor "org.hibernate.orm:hibernate-processor:7.2.12.Final"
annotationProcessor "org.hibernate.orm:hibernate-core:7.2.12.Final"
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.5"
// ---- 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.10.0"
// Override plexus-utils to fix Zip Slip vulnerability (GHSA-6fmv-xxpf-w3cw)
checkstyle "org.codehaus.plexus:plexus-utils:4.0.3"
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyle_version}"
// ---- TEST DEPENDENCIES ----
testImplementation "org.springframework.boot:spring-boot-starter-test:${spring_boot_version}"
// Required for MockMvc + Spring Security integration in Spring Boot 4 (auto-applies springSecurity() to MockMvc)
testImplementation "org.springframework.boot:spring-boot-security-test:${spring_boot_version}"
testImplementation "org.springframework.boot:spring-boot-webmvc-test:${spring_boot_version}"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.springframework.boot:spring-boot-test:${spring_boot_version}"
testImplementation "org.springframework:spring-test"
testImplementation "org.assertj:assertj-core:3.27.7"
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.4.1"
testImplementation "org.apache.maven.surefire:surefire-report-parser:3.5.5"
testImplementation "io.zonky.test:embedded-database-spring-test:2.8.0"
testImplementation "com.redis:testcontainers-redis:2.2.4"
testImplementation "org.testcontainers:testcontainers-weaviate:${testcontainers_version}"
testImplementation "com.icegreen:greenmail-junit5:2.1.8"
testImplementation "com.tngtech.archunit:archunit:1.4.2"
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:20251224"
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 "org.springframework.cloud:spring-cloud-dependencies:${spring_cloud_version}"
// BOM uses 3-part versions (e.g. 18.1.0); POSTGRES_VERSION from .env may be 2-part (e.g. 18.1)
def pgVersion = findProperty('postgres_version') ?: '18.1'
def bomVersion = pgVersion.count('.') < 2 ? "${pgVersion}.0" : pgVersion
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:${bomVersion}"
mavenBom "org.testcontainers:testcontainers-bom:${testcontainers_version}"
}
}
// Testcontainers 2.0 renamed modules with a "testcontainers-" prefix.
// Redirect old artifact names (used by Zonky and Spring Boot BOM) to the new ones.
configurations.matching { it.name != 'mockitoAgent' }.configureEach {
resolutionStrategy {
dependencySubstitution {
substitute module("org.testcontainers:mysql") using module("org.testcontainers:testcontainers-mysql:${testcontainers_version}")
substitute module("org.testcontainers:postgresql") using module("org.testcontainers:testcontainers-postgresql:${testcontainers_version}")
substitute module("org.testcontainers:jdbc") using module("org.testcontainers:testcontainers-jdbc:${testcontainers_version}")
substitute module("org.testcontainers:database-commons") using module("org.testcontainers:testcontainers-database-commons:${testcontainers_version}")
substitute module("org.testcontainers:weaviate") using module("org.testcontainers:testcontainers-weaviate:${testcontainers_version}")
substitute module("org.testcontainers:testcontainers") using module("org.testcontainers:testcontainers:${testcontainers_version}")
}
}
}
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)
}
def getMajorVersion = { String version ->
version.tokenize('.')[0]
}
tasks.named("dependencyUpdates").configure {
def rawSkipMajor = System.getProperty("skipMajorUpdates")
def skipMajor = rawSkipMajor != null && (rawSkipMajor.isBlank() || rawSkipMajor.toBoolean())
rejectVersionIf {
isNonStable(it.candidate.version) || (skipMajor && getMajorVersion(it.candidate.version) != getMajorVersion(it.currentVersion))
}
}
// Available commands:
//
// 1) Build production: ./gradlew -Pprod -Pwar clean bootWar
// 2) Execute tests (PostgreSQL, Docker required): ./gradlew test -x webapp
// 2a) Execute tests with coverage report: ./gradlew test jacocoTestReport -x webapp
// 2b) Execute tests with H2 (no Docker needed): ./gradlew test -x webapp -Dzonky.test.database.type=H2
// 2c) Execute tests with MySQL test container: ./gradlew testMysql -x webapp (requires Docker)
// 2d) Run a single test: ./gradlew test --tests ExamIntegrationTest -x webapp or ./gradlew test --tests ExamIntegrationTest.testGetExamScore -x webapp
// 2e) 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
// 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 -x webapp
// 6a) Find only minor/patch dependency updates: ./gradlew dependencyUpdates -Drevision=release -DskipMajorUpdates -x webapp
// 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)
// 16) Generate SBOM (Software Bill of Materials): ./gradlew cyclonedxBom -x webapp