forked from qudt/qudt-public-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
542 lines (533 loc) · 26.8 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
<?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>
<groupId>org.qudt</groupId>
<artifactId>qudt-public-repo</artifactId>
<version>2.1.47-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<qudtPrevReleaseYear>TODO-set-property-qudtPrevReleaseYear</qudtPrevReleaseYear>
<qudtPrevReleaseMonth>TODO-set-property-qudtPrevReleaseMonth</qudtPrevReleaseMonth>
</properties>
<scm>
<connection>scm:git:https://github.com/qudt/qudt-public-repo.git</connection>
<developerConnection>scm:git:https://github.com/qudt/qudt-public-repo.git</developerConnection>
<url>https://github.com/qudt/qudt-public-repo/tree/master</url>
<tag>HEAD</tag>
</scm>
<build>
<!--
project is built using
mvn install
the release zip is built using
mvn -Pzip install
-->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!--
this section defines the actions taken during the build.
The build is executed as a series of 'lifecycle phases': https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
Each plugin has an <execution> section that binds its execution to a lifecycle phase. (or it has a default lifecycle phase in which it runs)
Here are the phases and the execution ids that are linked to them (executed in the order they appear in this file):
validate defineAdditionalProperties, check-source-format
initialize delete-applicable-units, format-sources, copy-rdf, copy-docs, copy-root-files
generate-sources validate-shacl-files
process-sources replace-version-placeholder
generate-resources
process-resources
compile shacl-infer, merge-applicable-units
process-classes
generate-test-sources
process-test-sources
generate-test-resources
process-test-resources
test-compile
process-test-classes
test shacl-validate
prepare-package update-vaem-references, format-dist
package
pre-integration-test
integration-test
post-integration-test
verify
install release-zip (if -Pzip is present (profile 'zip' is activated)
deploy
-->
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<!-- we use placeholders in our files that are replaced with
appropriate values during the build.
This execution generates a number of new maven properties that
are later used as the replacement values, e.g. ${project.version.majorminor}.
-->
<id>defineAdditionalProperties</id>
<phase>validate</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoField
def majorMinorVersion = "${project.version}".replaceAll('^(\\w+.\\w+).*\$', '\$1')
project.properties.setProperty('project.version.majorminor', majorMinorVersion)
project.properties.setProperty('qudt.versioned.iri.prefix', "http://qudt.org/${majorMinorVersion}/")
def now = OffsetDateTime.now().with(ChronoField.MILLI_OF_SECOND, 0)
project.properties.setProperty('qudt.build.date', "${now}")
def currentMonth = now.format(DateTimeFormatter.ofPattern("MM"))
def currentYear = now.format(DateTimeFormatter.ofPattern("YYYY"))
project.properties.setProperty('qudt.current.month', currentMonth)
project.properties.setProperty('qudt.current.year', currentYear)
</source>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<!-- we replace this dependency of the groovy plugin because the version
it uses has security issues -->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.1.0-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.github.qudtlib</groupId>
<artifactId>shacl-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<!-- infers qudt:applicableUnits and writes them to target/inferred/applicableUnits.ttl -->
<id>shacl-infer</id>
<phase>compile</phase>
<goals>
<goal>infer</goal>
</goals>
<configuration>
<inferences>
<inference>
<shapes>
<include>src/build/inference/inferApplicableUnits.ttl</include>
</shapes>
<data>
<include>
src/main/rdf/vocab/unit/*.ttl
src/main/rdf/vocab/quantitykinds/*.ttl
</include>
</data>
<outputFile>target/inferred/applicableUnits.ttl</outputFile>
</inference>
</inferences>
</configuration>
</execution>
<execution>
<!--
SHACL-validates the union of all ttl files in dist/vocab and the No-OWL schema
against the union of QA-Tests and No-OWL schema
writes the validation report target/validation/validationReport.ttl
-->
<id>shacl-validate</id>
<phase>test</phase>
<goals>
<goal>validate</goal>
</goals>
<configuration>
<validations>
<validation>
<!--skip>true</skip-->
<shapes>
<include>
target/dist/validation/COLLECTION_QUDT_QA_TESTS_ALL.ttl
target/dist/schema/shacl/SCHEMA_QUDT_NoOWL.ttl
</include>
</shapes>
<data>
<include>
target/dist/schema/shacl/SCHEMA_QUDT_NoOWL.ttl
target/dist/vocab/**/*.ttl
</include>
</data>
<outputFile>target/validation/validationReport.ttl</outputFile>
</validation>
</validations>
</configuration>
</execution>
<execution>
<!--
SHACL-that the SHACL definition conform to SHACL
writes the validation report target/validation/validationReportShacl.ttl
-->
<id>validate-shacl-files</id>
<phase>generate-sources</phase>
<goals>
<goal>validate</goal>
</goals>
<configuration>
<validations>
<validation>
<!--skip>true</skip-->
<shapes>
<include>src/build/validation/SHACL-SHACL.ttl</include>
</shapes>
<data>
<include>
src/main/rdf/validation/COLLECTION_QUDT_QA_TESTS_ALL.ttl
src/main/rdf/validation/COLLECTION_QUDT_USER_TESTS.ttl
src/main/rdf/schema/shacl/SCHEMA_QUDT_NoOWL.ttl
</include>
</data>
<outputFile>target/validation/validationReportShacl.ttl</outputFile>
</validation>
</validations>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.qudtlib</groupId>
<artifactId>rdfio-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<!--
deletes any qudt:applicableUnits triples from the quantitykinds **source** file.
Note: this operation leaves the file unformatted (jena TTL Pretty output - nice, but
not our format) Therefore, we need to format this file later using spotless.
-->
<id>delete-applicable-units</id>
<phase>initialize</phase>
<goals>
<goal>make</goal>
</goals>
<configuration>
<products>
<singleFile>
<input>
<include>
src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl
</include>
</input>
<filters>
<exclude>
<predicate>qudt:applicableUnit</predicate>
</exclude>
</filters>
<outputFile>src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl</outputFile>
</singleFile>
</products>
</configuration>
</execution>
<execution>
<!--
adds the qudt:applicableUnits triples we generated with SHACL to the quantitykinds target file.
-->
<id>merge-applicable-units</id>
<phase>compile</phase>
<goals>
<goal>make</goal>
</goals>
<configuration>
<products>
<singleFile>
<input>
<include>
target/inferred/applicableUnits.ttl
target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl
</include>
</input>
<outputFile>target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl</outputFile>
</singleFile>
</products>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.44.0.BETA3</version>
<configuration>
<!-- default configuration - this is the one that is used if the plugin is
invoked directly using `mvn spotless:apply` or `mvn spotless:check`
-->
<rdf>
<includes>
<include>src/main/rdf/**/*.ttl</include>
<include>src/build/inference/**/*.ttl</include>
<include>target/**/*.ttl</include>
</includes>
<format>
<failOnWarning>false</failOnWarning>
<verify>true</verify>
<turtleFormatterVersion>1.2.14</turtleFormatterVersion>
<turtle>
<predicateOrder>rdf:type,owl:imports</predicateOrder>
<firstPredicateInNewLine>true</firstPredicateInNewLine>
</turtle>
</format>
</rdf>
<markdown>
<includes>
<include>**/*.md</include>
</includes>
<flexmark />
</markdown>
<formats>
<!--
does our placeholder replacements using the maven properties
that were set using the groovy plugin
-->
<format>
<includes>
<include>target/dist/**/*.*</include>
</includes>
<excludes>
<include>target/**/*.xlsx</include>
<include>target/**/*.xls</include>
<include>target/**/*.gif</include>
<include>target/**/*.zip</include>
<include>target/**/*.pdf</include>
<include>target/**/*.ppt</include>
<include>target/**/*.pptx</include>
</excludes>
<replaceRegex>
<name>full version replacement</name>
<searchRegex>\$\$QUDT_VERSION\$\$</searchRegex>
<replacement>${project.version}</replacement>
</replaceRegex>
<replaceRegex>
<name>major.minor version replacement</name>
<searchRegex>\$\$QUDT_MAJOR_MINOR_VERSION\$\$</searchRegex>
<replacement>${project.version.majorminor}</replacement>
</replaceRegex>
<replace>
<name>publish date replacement</name>
<search>1234-12-12T12:34:56Z</search>
<replacement>${qudt.build.date}</replacement>
</replace>
<replaceRegex>
<name>versioned IRI replacement</name>
<searchRegex>http://qudt.org/\d+.\d+/</searchRegex>
<replacement>${qudt.versioned.iri.prefix}</replacement>
</replaceRegex>
<replace>
<name>current year</name>
<search>$$$$CURRENT_YEAR$$$$</search>
<replacement>${qudt.current.year}</replacement>
</replace>
<replace>
<name>current month</name>
<search>$$$$CURRENT_MONTH$$$$</search>
<replacement>${qudt.current.month}</replacement>
</replace>
<replace>
<name>current year</name>
<search>$$$$QUDT_PREV_RELEASE_YEAR$$$$</search>
<replacement>${qudtPrevReleaseYear}</replacement>
</replace>
<replace>
<name>current month</name>
<search>$$$$QUDT_PREV_RELEASE_MONTH$$$$</search>
<replacement>${qudtPrevReleaseMonth}</replacement>
</replace>
</format>
</formats>
</configuration>
<executions>
<execution>
<!--
checks formats in all files we care about before anything else
happens in the build.
Note: The more comfortable alternative would be to
start with formatting everything, but we cannot do it: it would allow
for a commit to contain non-formatted files. Those files would be formatted
during the server-side build but not updated in the repo. A subsequent
merge/rebase to our main branch would lead to having unformatted files in
the main branch.
-->
<id>check-source-format</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rdf>
<excludes>
<exclude>**/target/**/*.*</exclude>
</excludes>
</rdf>
</configuration>
</execution>
<execution>
<!-- formats source files that were generated during the build up to the compile phase -->
<id>reformat-sources</id>
<phase>compile</phase>
<goals>
<goal>apply</goal>
</goals>
<configuration>
<upToDateChecking>
<enabled>false</enabled>
</upToDateChecking>
<rdf>
<!-- redefine includes so we only format the sources that are allowed to change -->
<includes>
<include>src/main/rdf/vocab/quantitykinds/*.ttl</include>
</includes>
</rdf>
</configuration>
</execution>
<execution>
<!-- formats everything in the target/dist folder so we have a clean set of distribution files-->
<id>format-dist</id>
<phase>prepare-package</phase>
<goals>
<goal>apply</goal>
</goals>
<configuration>
<upToDateChecking>
<enabled>false</enabled>
</upToDateChecking>
<rdf>
<!-- redefine rdf includes to only include target/dist -->
<includes>
<include>target/**/*.ttl</include>
</includes>
</rdf>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<!-- copies all required files from src or root dir to the target folder -->
<executions>
<execution>
<id>copy-rdf</id>
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/dist</outputDirectory>
<resources>
<resource>
<directory>src/main/rdf</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-docs</id>
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/dist/docs</outputDirectory>
<resources>
<resource>
<directory>src/main/docs</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-root-files</id>
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/dist</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>*.md</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
<!--
we want to suppress this plugin, which makes no sense unless we want to
allow people to use qudt as a maven dependency
-->
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<!--
we want to suppress this plugin, which makes no sense unless we want to
allow people to use qudt as a maven dependency AND we want to publish it
to a maven registry
-->
<configuration>
<!-- we never want to deploy, our github actions take care of that -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!--
profiles are activated using the -P[profileName] command line arg to the mvn command
if activated, the structure contained in the <profile> element is merged with the pom structure.
-->
<profile>
<!-- profile that causes the zip file to be created -->
<id>zip</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/build/assembly/releaseZip.xml</descriptor>
</descriptors>
<finalName>${project.name}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>release-zip</id>
<goals>
<goal>single</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>