-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
529 lines (485 loc) · 15.9 KB
/
pom.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-shares-server</artifactId>
<version>0.4.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cdoc2-shares-server</name>
<description>CDOC2 server for storing/retrieving key shares. Key shares are used to
split/recreate encryption/decryption key material for auth means (Smart-ID/Mobile-ID).
Implements `/key-shares` OAS https://github.com/open-eid/cdoc2-openapi . Full
auth means schema description https://open-eid.github.io/CDOC2/
</description>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tests>!(pkcs11 | slow)</tests>
<spring-boot.version>3.4.1</spring-boot.version>
<spring.version>6.2.1</spring.version>
<org-testcontainers.version>1.20.4</org-testcontainers.version>
<micrometer.version>1.14.2</micrometer.version>
<logback-classic.version>1.5.16</logback-classic.version>
<!-- https://docs.spring.io/spring-boot/docs/current/reference/html/dependency-versions.html#appendix.dependency-versions.properties-->
<!-- force usage of newer logback as SB 3.2.5 depends on vulnerable 1.4.14 -->
<logback.version>1.5.16</logback.version>
</properties>
<profiles>
<profile>
<id>allTests</id>
<properties>
<!-- empty, means all tests-->
<tests />
</properties>
</profile>
<profile>
<id>no-maven.test.skip-defined</id>
<!-- remove test dependencies when maven.test.skip=true is defined -->
<!-- although maven.test.skip=true doesn't compile tests, maven still requires test dependencies -->
<activation>
<property>
<name>!maven.test.skip</name> <!-- Activates when maven.test.skip is NOT defined -->
</property>
</activation>
<dependencies>
<!-- dependencies required for compiling tests -->
<dependency>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-client</artifactId>
<version>SID-1.6.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>excludePkcs11AndSlowTests</id>
<properties>
<tests>!(pkcs11 | slow)</tests>
</properties>
</profile>
<profile>
<id>github_ci_fork</id>
<!-- for forks use base maven repo "open-eid/cdoc2-java-ref-impl" -->
<activation>
<property>
<!-- defined by maven.yml for forks only -->
<name>env.BASE_REPO</name>
</property>
</activation>
<properties>
<github_ci.maven_repo>https://maven.pkg.github.com/${env.BASE_REPO}</github_ci.maven_repo>
</properties>
</profile>
<profile>
<id>github_ci_not_fork_or_not_pull_request</id>
<activation>
<property>
<!-- set by maven.yml for forks only -->
<name>env.IS_FORK</name>
<!-- "is_fork" is not defined, or is defined with a value which is not "true". -->
<value>!true</value>
</property>
</activation>
<properties>
<!--suppress UnresolvedMavenProperty -->
<github_ci.maven_repo>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</github_ci.maven_repo>
</properties>
</profile>
<profile>
<id>overwrite "github_ci.maven_repo" from env var "MAVEN_REPO"</id>
<activation>
<property>
<name>env.MAVEN_REPO</name>
</property>
</activation>
<properties>
<github_ci.maven_repo>https://maven.pkg.github.com/${env.MAVEN_REPO}</github_ci.maven_repo>
</properties>
</profile>
<profile>
<!-- activate github profile when run by github actions -->
<id>github_ci</id>
<activation>
<property>
<name>env.GITHUB_ACTIONS</name>
<value>true</value>
</property>
</activation>
<repositories>
<repository>
<!-- must have matching server.id in settings.xml -->
<!-- github actions/checkout default for server-id is "github"-->
<id>github</id>
<!-- When pulling, the package index is based on the organization level, not the repository level. -->
<!-- Although GITHUB_REPOSITORY contains repo, all organization packages are indexed there -->
<!-- https://stackoverflow.com/questions/63041402/github-packages-single-maven-repository-for-github-organization -->
<!--suppress UnresolvedMavenProperty -->
<url>${github_ci.maven_repo}</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>github</id>
<!--suppress UnresolvedMavenProperty -->
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
</repository>
<snapshotRepository>
<id>github</id>
<!--suppress UnresolvedMavenProperty -->
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<!-- set gitlab.ext profile active when run by gitlab CI -->
<id>gitlab_ci</id>
<activation>
<property>
<name>env.GITLAB_CI</name>
<value>true</value>
</property>
</activation>
<!-- repositories are configured in settings.xml -->
<!--repositories></repositories-->
<distributionManagement>
<!-- env variables are available, when run by gitlab CI -->
<repository>
<id>${env.CI_SERVER_HOST}</id>
<!--suppress UnresolvedMavenProperty -->
<url>${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</repository>
<snapshotRepository>
<id>${env.CI_SERVER_HOST}</id>
<!--suppress UnresolvedMavenProperty -->
<url>${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-auth-token</artifactId>
<version>0.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-css-openapi</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-css-db</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<scope>compile</scope>
<type>pom</type>
</dependency>
<!-- metrics using micrometer -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<!--
without jaxp-api dependency server will fail to start with:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory'
defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]:
Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- metrics using micrometer -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${org-testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>${org-testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.27.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<configLocation>../checkstyle.xml</configLocation>
<suppressionsLocation>../checkstyle-suppressions.xml</suppressionsLocation>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<failOnViolation>false</failOnViolation>
<linkXRef>false</linkXRef>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-keys-and-certificates-to-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!--referenced from application-test.properties for running through IntelliJ-->
<outputDirectory>${basedir}/src/test/resources/keystore</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../keys</directory>
<includes>
<include>cdoc2server.p12</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>clean</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete file="${basedir}/src/test/resources/test.properties" />
<delete file="${basedir}/src/test/resources/keystore/cdoc2server.p12" />
</target>
</configuration>
</execution>
<execution>
<id>generate-test.properties</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- create properties file for tests -->
<echo file="${basedir}/src/test/resources/test.properties" append="false">cdoc2.keys.dir=${basedir}${file.separator}..${file.separator}keys
</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<groups>${tests}</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- compile tests as a jar for use by server projects -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- generate build info -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<image>
<env>
<BP_JVM_VERSION>21</BP_JVM_VERSION>
<BP_SPRING_CLOUD_BINDINGS_DISABLED>true</BP_SPRING_CLOUD_BINDINGS_DISABLED>
<!--suppress UnresolvedMavenProperty -->
<BP_DEPENDENCY_MIRROR>${bp.dependency.mirror}</BP_DEPENDENCY_MIRROR>
<BPL_SPRING_CLOUD_BINDINGS_DISABLED>true</BPL_SPRING_CLOUD_BINDINGS_DISABLED>
<!--suppress UnresolvedMavenProperty -->
<HTTP_PROXY>${http.proxy}</HTTP_PROXY>
<!--suppress UnresolvedMavenProperty -->
<HTTPS_PROXY>${https.proxy}</HTTPS_PROXY>
</env>
<!--suppress UnresolvedMavenProperty -->
<tags>${spring-boot.build-image.tags}</tags>
</image>
<docker>
<publishRegistry>
<!--suppress UnresolvedMavenProperty -->
<url>${docker.publishRegistry.url}</url>
<!--suppress UnresolvedMavenProperty -->
<username>${docker.publishRegistry.username}</username>
<!--suppress UnresolvedMavenProperty -->
<password>${docker.publishRegistry.password}</password>
</publishRegistry>
</docker>
</configuration>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- if exact RELEASE version of module already exists, -->
<!-- then skip deployment by setting maven.deploy.skip=true property for that module -->
<!-- GitHub doesn't allow overwriting existing RELEASE modules and deploy will fail with HTTP 409 -->
<plugin>
<groupId>org.honton.chas</groupId>
<artifactId>exists-maven-plugin</artifactId>
<version>0.13.0</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>remote</goal>
</goals>
<configuration>
<!-- run only if deploy goal is specified in maven command line -->
<requireGoal>deploy</requireGoal>
</configuration>
</execution>
</executions>
<configuration>
<failIfNotMatch>false</failIfNotMatch>
<userProperty>false</userProperty>
<!--skip>true</skip-->
</configuration>
</plugin>
</plugins>
</build>
</project>