-
Notifications
You must be signed in to change notification settings - Fork 7
/
pom.xml
606 lines (561 loc) · 20.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
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
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cantaloupe</artifactId>
<version>${revision}</version>
<name>docker-cantaloupe</name>
<description>A Docker build and test framework for Cantaloupe</description>
<url>https://github.com/uclalibrary/docker-cantaloupe</url>
<licenses>
<license>
<name>The 3-Clause BSD License</name>
<url>https://opensource.org/licenses/BSD-3-clause</url>
</license>
</licenses>
<scm>
<connection>scm:git:[email protected]:uclalibrary/docker-cantaloupe.git</connection>
<developerConnection>scm:git:[email protected]:uclalibrary/docker-cantaloupe.git</developerConnection>
<url>[email protected]:uclalibrary/docker-cantaloupe.git</url>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/uclalibrary/docker-cantaloupe/issues</url>
</issueManagement>
<developers>
<developer>
<id>ksclarke</id>
<name>Kevin S. Clarke</name>
<email>[email protected]</email>
<organization>UCLA Library</organization>
<organizationUrl>http://github.com/uclalibrary</organizationUrl>
<timezone>America/New_York</timezone>
</developer>
<developer>
<id>cachemeoutside</id>
<name>Anthony Vuong</name>
<email>[email protected]</email>
<organization>UCLA Library</organization>
<organizationUrl>http://github.com/uclalibrary</organizationUrl>
<timezone>America/Los_Angeles</timezone>
</developer>
<developer>
<id>markmatney</id>
<name>Mark A. Matney, Jr.</name>
<email>[email protected]</email>
<organization>UCLA Library</organization>
<organizationUrl>http://github.com/uclalibrary</organizationUrl>
<timezone>America/Los_Angeles</timezone>
</developer>
<developer>
<id>DRickard</id>
<name>David Rickard</name>
<email>[email protected]</email>
<organization>UCLA Library</organization>
<organizationUrl>http://github.com/uclalibrary</organizationUrl>
<timezone>America/Los_Angeles</timezone>
</developer>
</developers>
<properties>
<!-- What versions of Cantaloupe and Kakadu are we using? -->
<cantaloupe.version>5.0.6</cantaloupe.version>
<cantaloupe.commit.ref></cantaloupe.commit.ref>
<cantaloupe.apply.patchfiles>false</cantaloupe.apply.patchfiles>
<kakadu.version></kakadu.version>
<!-- Git repo with Kakadu source code (ours is private; override with yours) -->
<kakadu.git.repo>scm:git:[email protected]:uclalibrary/kakadu.git</kakadu.git.repo>
<!-- Docker container dependency versions -->
<!-- https://packages.ubuntu.com/search?keywords=search -->
<ubuntu.tag>22.04</ubuntu.tag>
<openjdk.version>17.0.12+7-1ubuntu2~22.04</openjdk.version>
<gcc.version>4:11.2.0-1ubuntu1</gcc.version>
<make.version>4.3-4.1build1</make.version>
<libtiff.version>4.3.0-6ubuntu0.10</libtiff.version>
<build.essential.version>12.9ubuntu3</build.essential.version>
<libopenjp2.version>2.4.0-6</libopenjp2.version>
<libturbojpeg.version>2.1.2-0ubuntu1</libturbojpeg.version>
<unzip.version>6.0-26ubuntu3.2</unzip.version>
<zip.version>3.0-12build2</zip.version>
<curl.version>7.81.0-1ubuntu1.18</curl.version>
<ffmpeg.version>7:4.4.2-0ubuntu0.22.04.1</ffmpeg.version>
<python2.version>2.7.18-3</python2.version>
<libperl.version>5.34.0-3ubuntu1.3</libperl.version>
<!-- Java dependency versions -->
<freelib.utils.version>5.0.5</freelib.utils.version>
<maven.jar.version>3.4.2</maven.jar.version>
<jsoup.version>1.18.1</jsoup.version>
<json.version>20240303</json.version>
<scm.plugin.version>2.1.0</scm.plugin.version>
<deploy.plugin.version>3.1.3</deploy.plugin.version>
<codacy.plugin.version>1.2.0</codacy.plugin.version>
<xml.maven.plugin.version>1.1.0</xml.maven.plugin.version>
<docker.maven.plugin.version>0.45.1</docker.maven.plugin.version>
<maven.download.plugin.version>1.11.2</maven.download.plugin.version>
<!-- What level of logging we want to see, by default, in our tests and default container config -->
<logLevel>ERROR</logLevel>
<testLogLevel>ERROR</testLogLevel>
<!-- The Docker registry user and password used for publishing images -->
<docker.registry.username />
<docker.registry.password />
<!-- The registry account, if supplied, must end with a slash (e.g. "account/") -->
<docker.registry.account />
<!-- The artifact is qualified if it's built with Kakadu -->
<artifact.qualifier></artifact.qualifier>
<!-- Additional Docker configurations -->
<docker.cleanup>remove</docker.cleanup>
<docker.image>cantaloupe${artifact.qualifier}</docker.image>
<docker.showLogs>true</docker.showLogs>
<!-- We don't need to build the jar outside of the Docker build -->
<jar.phase></jar.phase>
<!-- The image root when running the test instance of Cantaloupe -->
<image.root>src/test/resources/images/</image.root>
<!-- Override this to set the admin UI password when running in test mode -->
<admin.password></admin.password>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>info.freelibrary</groupId>
<artifactId>freelib-utils</artifactId>
<version>${freelib.utils.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${json.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
<excludes>
<!-- We don't need to filter binary files -->
<exclude>images/*.tif</exclude>
<exclude>images/*.jpx</exclude>
<exclude>images/*.png</exclude>
<exclude>images/*.jpg</exclude>
<exclude>images/*.gif</exclude>
<exclude>images/*.jp2</exclude>
<exclude>*.enc</exclude>
</excludes>
</testResource>
<!-- We can also override the default logging configuration with a file in our root project directory -->
<testResource>
<directory>${basedir}</directory>
<includes>
<include>logback-test.xml</include>
</includes>
<excludes>
<!-- We don't need to filter binary files -->
<exclude>images/*.tif</exclude>
<exclude>images/*.jpx</exclude>
<exclude>images/*.png</exclude>
<exclude>images/*.jpg</exclude>
<exclude>images/*.gif</exclude>
<exclude>images/*.jp2</exclude>
<exclude>*.enc</exclude>
</excludes>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<!-- We can skip building the Jar except when Docker runs the build -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>${jar.phase}</phase>
</execution>
</executions>
</plugin>
<!-- We don't install the Jar but package it up in our Docker image -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<!-- Deploying Docker image instead of a Jar file so skip this -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${deploy.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Generates a message bundle class for use in the Java tests -->
<!--<![CDATA[
To run the generate-codes plugin manually: mvn info.freelibrary:freelib-maven-plugins:generate-codes
]]>-->
<plugin>
<groupId>info.freelibrary</groupId>
<artifactId>freelib-maven-plugins</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>generate-codes</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PMD is an extensible cross-language static code analyzer -->
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
<!-- Generates Javadocs -->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<dependencies>
<dependency>
<groupId>info.freelibrary</groupId>
<artifactId>freelib-resources</artifactId>
<version>${freelib.resources.version}</version>
</dependency>
</dependencies>
<configuration>
<stylesheetfile>javadocs.css</stylesheetfile>
<nonavbar>true</nonavbar>
<show>public</show>
<nosince>true</nosince>
<notimestamp>true</notimestamp>
<bottom> </bottom>
<detectLinks>false</detectLinks>
<additionalJOptions>
<additionalJOption>-J-Dhttp.agent=maven-javadoc-plugin-${project.name}</additionalJOption>
</additionalJOptions>
<links>
<link>https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/</link>
</links>
<sourcepath>src/main/java:src/main/generated</sourcepath>
</configuration>
<executions>
<execution>
<id>site-javadocs</id>
<phase>site</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Checkstyle ensures adherence to coding standards -->
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>src/main/tools/checkstyle/checkstyle-suppressions-override.xml</suppressionsLocation>
</configuration>
</plugin>
<!-- Enforcer enforces some basic characteristics of the project -->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<!-- Maven dependency helps freelib-resources copy files into the project -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<!-- The build-helper plug-in gets us a dynamic port for testing -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<!-- Download test images -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>${maven.download.plugin.version}</version>
<executions>
<execution>
<id>install-test-images</id>
<phase>generate-test-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<!-- Download some test images too large to store in GitHub -->
<configuration>
<url>https://cantaloupe-test-data.s3.amazonaws.com/jiiify-image-test-images.zip</url>
<unpack>true</unpack>
<outputDirectory>src/test/resources/images</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Check the project's XML files to make sure they are well-formed -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>${xml.maven.plugin.version}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<validationSets>
<validationSet>
<dir>src/main/resources</dir>
<includes>cantaloupe_messages.xml</includes>
</validationSet>
<validationSet>
<dir>src/test/resources</dir>
<includes>logback-test.xml</includes>
</validationSet>
</validationSets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>publishedBuild</id>
<activation>
<property>
<name>!versions</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<logStdout>true</logStdout>
<verbose>true</verbose>
<images>
<image>
<name>${docker.image}</name>
<build>
<dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>
</build>
<run>
<ports>
<port>${http.port}:8182</port> <!-- Start test container on an available host port -->
</ports>
<volumes>
<bind>
<volume>${image.root}:/imageroot/</volume>
</bind>
</volumes>
<env>
<CANTALOUPE_LOG_APPLICATION_LEVEL>info</CANTALOUPE_LOG_APPLICATION_LEVEL>
<CANTALOUPE_ENDPOINT_ADMIN_ENABLED>true</CANTALOUPE_ENDPOINT_ADMIN_ENABLED>
<CANTALOUPE_ENDPOINT_ADMIN_SECRET>${admin.password}</CANTALOUPE_ENDPOINT_ADMIN_SECRET>
</env>
<wait>
<http>
<url>http://localhost:${http.port}</url>
<method>GET</method>
<status>200</status>
</http>
<!-- Below depends on 'info' logging being set -->
<log>Started @</log>
</wait>
</run>
</image>
</images>
<authConfig>
<username>${docker.registry.username}</username>
<password>${docker.registry.password}</password>
</authConfig>
</configuration>
<executions>
<!-- Builds the Docker image -->
<execution>
<id>docker-build</id>
<phase>pre-integration-test</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<!-- Starts the Docker container for integration testing -->
<execution>
<id>docker-start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<!-- Stops the integration tests' Docker container -->
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
<!-- If tests succeed, deploys the Docker image to DockerHub -->
<execution>
<id>docker-deploy</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- JUnit runs our tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*</exclude>
</excludes>
<forkCount>1</forkCount><!-- Multiple forks result in multiple containers -->
<useSystemClassLoader>false</useSystemClassLoader> <!-- Override parent project setting -->
</configuration>
<executions>
<execution>
<id>functional-tests</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*FT.java</include>
<include>**/*IT.java</include>
</includes>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
<argLine>${jacoco.agent.arg}</argLine>
<systemPropertyVariables>
<cantaloupe.version>${cantaloupe.version}</cantaloupe.version>
<http.port>${http.port}</http.port>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--A profile that builds Kakadu's proprietary source code -->
<profile>
<id>kakadu</id>
<activation>
<property>
<name>kakadu.version</name>
</property>
</activation>
<properties>
<!-- This can be overridden from the command line -->
<artifact.qualifier>-ucla</artifact.qualifier>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>${scm.plugin.version}</version>
<executions>
<execution>
<id>kakadu-checkout</id>
<phase>generate-sources</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<checkoutDirectory>${basedir}/src/main/docker/kakadu</checkoutDirectory>
<connectionUrl>${kakadu.git.repo}</connectionUrl>
<scmVersionType>branch</scmVersionType>
<scmVersion>main</scmVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- A profile that outputs the latest versions of the installed system dependencies -->
<profile>
<id>versions</id>
<activation>
<property>
<name>versions</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<logStdout>true</logStdout>
<verbose>true</verbose>
<images>
<image>
<name>cantaloupe-versions:latest</name>
<build>
<from>ubuntu:${ubuntu.tag}</from>
<assembly>
<descriptorRef>project</descriptorRef>
</assembly>
<runCmds>
<shell>/maven/src/main/docker/scripts/show_versions.sh</shell>
</runCmds>
<entryPoint>tail -f /dev/null</entryPoint>
</build>
</image>
</images>
<authConfig>
<username>${docker.registry.username}</username>
<password>${docker.registry.password}</password>
</authConfig>
</configuration>
<executions>
<!-- Builds the Docker image -->
<execution>
<id>docker-build</id>
<phase>validate</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<parent>
<groupId>info.freelibrary</groupId>
<artifactId>freelib-parent</artifactId>
<version>12.0.0</version>
</parent>
</project>