-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
170 lines (143 loc) · 5.8 KB
/
Copy pathbuild.gradle
File metadata and controls
170 lines (143 loc) · 5.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
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.4'
id 'io.spring.dependency-management' version '1.1.7'
id "com.github.ben-manes.versions" version "0.53.0"
}
group = 'com.digitalsanctuary.springuser.demo'
version = '1.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
// Define the configurations used in the project
configurations {
developmentOnly
runtimeOnly {
extendsFrom developmentOnly
}
testImplementation {
extendsFrom runtimeOnly
}
compileOnly {
extendsFrom annotationProcessor
}
dev
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// DigitalSanctuary Spring User Framework
implementation 'com.digitalsanctuary:ds-spring-user-framework:5.0.1'
// WebAuthn support (Passkey authentication)
implementation 'org.springframework.security:spring-security-webauthn'
// Spring Boot starters
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
// Thymeleaf extras - Spring Boot 4 manages the version
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
// Workaround for GROOVY-11745: Groovy 5.0.4 (shipped with Spring Boot 4.0.3) has a
// regression that causes an NPE when Groovy 5 code calls setters on objects from
// Groovy 4-compiled libraries. This breaks thymeleaf-layout-dialect 3.4.0 (compiled
// with Groovy 4.0.25) in DecorateProcessor.doProcess().
// See: https://issues.apache.org/jira/browse/GROOVY-11745
// See: https://github.com/ultraq/thymeleaf-layout-dialect/issues/251
// TODO: Remove this workaround when Groovy 5.0.5+ is available and adopted by Spring Boot
implementation('nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.4.0') {
exclude group: 'org.apache.groovy'
}
implementation 'org.apache.groovy:groovy:5.0.3'
// OpenAPI (Swagger)
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
// Runtime dependencies
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.7'
runtimeOnly 'org.postgresql:postgresql'
// Docker Compose support for local development
developmentOnly 'org.springframework.boot:spring-boot-docker-compose'
// Utility libraries
// (passay is provided transitively by ds-spring-user-framework at the version it requires; the demo
// app does not use passay directly, so declaring/pinning it here previously forced a conflicting
// downgrade of the library's required passay version.)
implementation 'com.google.guava:guava:33.5.0-jre'
implementation 'org.hibernate.validator:hibernate-validator'
// Compile-only dependencies
compileOnly 'org.projectlombok:lombok'
// Annotation processors
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
// Testing dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'com.h2database:h2:2.4.240'
// OAuth2 Testing dependencies
testImplementation 'org.wiremock:wiremock-standalone:3.13.2'
testImplementation 'io.jsonwebtoken:jjwt-api:0.13.0'
testRuntimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
testRuntimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
}
test {
useJUnitPlatform {
}
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// showStandardStreams = true // Display log output
}
}
bootRun {
// Use Spring Boot DevTool only when we run Gradle bootRun task
classpath = sourceSets.main.runtimeClasspath + configurations.developmentOnly
sourceResources sourceSets.main
if (project.hasProperty('profiles')) {
environment SPRING_PROFILES_ACTIVE: profiles
} else {
def profiles = 'local'
environment SPRING_PROFILES_ACTIVE: profiles
}
}
// Playwright Test Integration
tasks.register('playwrightInstall', Exec) {
description = 'Install Playwright dependencies'
group = 'verification'
workingDir 'playwright'
commandLine 'npm', 'install'
}
tasks.register('playwrightBrowsers', Exec) {
description = 'Install Playwright browsers'
group = 'verification'
workingDir 'playwright'
commandLine 'npx', 'playwright', 'install'
dependsOn 'playwrightInstall'
}
tasks.register('playwrightTest', Exec) {
description = 'Run Playwright E2E tests'
group = 'verification'
workingDir 'playwright'
commandLine 'npx', 'playwright', 'test'
dependsOn 'playwrightBrowsers'
}
tasks.register('playwrightTestChromium', Exec) {
description = 'Run Playwright E2E tests on Chromium only'
group = 'verification'
workingDir 'playwright'
commandLine 'npx', 'playwright', 'test', '--project=chromium'
dependsOn 'playwrightBrowsers'
}
tasks.register('playwrightReport', Exec) {
description = 'Show Playwright test report'
group = 'verification'
workingDir 'playwright'
commandLine 'npx', 'playwright', 'show-report'
}