-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
845 lines (835 loc) · 30 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
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
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
<?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>su.pernova</groupId>
<artifactId>bom</artifactId>
<name>Supernova BOM</name>
<description>Bill of materials and definition of standards for Supernova projects.</description>
<url>https://github.com/peterdemaeyer/supernova-bom/</url>
<version>${revision}${changelist}</version>
<packaging>pom</packaging>
<licenses>
<license>
<name>MIT License</name>
<url>https://raw.githubusercontent.com/peterdemaeyer/supernova-bom/main/LICENSE.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Peter De Maeyer</name>
<email>[email protected]</email>
<organization>Supernova</organization>
<organizationUrl>https://github.com/peterdemaeyer/</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/peterdemaeyer/supernova-bom.git</connection>
<developerConnection>scm:git:ssh://github.com:peterdemaeyer/supernova-bom.git</developerConnection>
<url>https://github.com/peterdemaeyer/supernova-bom/tree/main/</url>
<tag>${project.version}</tag>
</scm>
<properties>
<revision>2.0.0</revision>
<changelist>-SNAPSHOT</changelist>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Use two decimal places in reporting. -->
<jacoco.coverage.minimum>1.00</jacoco.coverage.minimum>
<!-- Dependency versions (alphabetically). -->
<checkstyle.version>10.12.2</checkstyle.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-io.version>2.13.0</commons-io.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-text.version>1.11.0</commons-text.version>
<jackson.version>2.17.2</jackson.version>
<junit-jupiter.version>5.10.2</junit-jupiter.version>
<junit-platform.version>1.10.2</junit-platform.version>
<log4j.version>2.23.1</log4j.version>
<mockito.version>5.11.0</mockito.version>
<!-- Maven plugin versions (alphabetically). -->
<build-helper-maven-plugin.version>3.5.0</build-helper-maven-plugin.version>
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-failsafe-plugin.version>3.1.2</maven-failsafe-plugin.version>
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<maven-enforcer-plugin.version>3.3.0</maven-enforcer-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-shade-plugin.version>3.5.1</maven-shade-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-toolchains-plugin.version>3.1.0</maven-toolchains-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<dependencyManagement>
<!-- Alphabetically, by group ID then by artifact ID. -->
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- Compatibility with SLF4J. -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<!-- Compatibility with Log4j 1.2. -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>commons</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>metrics</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>metrics</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>search</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>serialization</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>units</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>su.pernova</groupId>
<artifactId>statistics</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-toolchains-plugin</artifactId>
<version>${maven-toolchains-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<failIfNoTests>false</failIfNoTests>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*ContractTest.java</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<!-- Supernova defines *IntegrationTest as integration test name pattern instead of the default *IT. -->
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>define-supernova-properties-validate</id>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<properties>
<property>supernova.multiModule.parent</property>
<property>supernova.multiModule.child</property>
<property>supernova.multiModule.aggregate</property>
<property>supernova.multiModule.parentDir</property>
<property>supernova.multiModule.aggregateDir</property>
<property>supernova.jacoco.skipCopyResources</property>
<property>supernova.jacoco.skipMerge</property>
<property>supernova.jacoco.skipReport</property>
<property>supernova.jacoco.skipCheck</property>
<property>supernova.jacoco.reportTitle</property>
</properties>
<source>
import java.io.File;
import java.util.function.Supplier;
boolean getOrDefault(Properties properties, String name, Supplier supplier) {
String value = properties.getProperty(name);
if (value == null) {
return (Boolean) supplier.get();
}
return Boolean.parseBoolean(value);
}
properties = project.getProperties();
supernova.multiModule.parent = project.getArtifactId().endsWith("-parent");
parent = project.getParent();
supernova.multiModule.child = (parent != null) && parent.getArtifactId().endsWith("-parent");
supernova.multiModule.aggregate = supernova.multiModule.child && project.getArtifactId().endsWith("-aggregate");
supernova.multiModule.parentDir = (parent != null) ? parent.getBasedir() : null;
supernova.multiModule.aggregateDir = (parent != null) ? new File(supernova.multiModule.parentDir, parent.getArtifactId().replace("-parent", "-aggregate")) : null;
// Unfortunately, BeanShell does not support lambdas, so we have to spell out an anonymous inner class.
notNonAggregateChildSupplier = new Supplier() {
Boolean get() {
return !supernova.multiModule.child || supernova.multiModule.aggregate;
}
};
// Unfortunately, BeanShell does not support inline anonymous inner classes, so we have to define a variable for them.
supernova.jacoco.skipCopyResources = getOrDefault(properties, "supernova.jacoco.skipCopyResources", notNonAggregateChildSupplier);
// Merging serves two purposes:
// 1. In a regular module, merges UT an IT execution data files.
// 2. In an aggregate module, merges execution data files from all modules within reactor.
falseSupplier = new Supplier() {
Boolean get() {
return false;
}
};
supernova.jacoco.skipMerge = getOrDefault(properties, "supernova.jacoco.skipMerge", falseSupplier);
nonAggregateChildSupplier = new Supplier() {
Boolean get() {
return supernova.multiModule.child && !supernova.multiModule.aggregate;
}
};
supernova.jacoco.skipReport = getOrDefault(properties, "supernova.jacoco.skipReport", nonAggregateChildSupplier);
supernova.jacoco.reportTitle = properties.getProperty("supernova.jacoco.reportTitle");
if (supernova.jacoco.reportTitle == null) {
String artifactId = project.getArtifactId();
// For multi-modules, strip the "-aggregate" from the artifact ID for the JaCoCo report title.
supernova.jacoco.reportTitle = supernova.multiModule.aggregate ? artifactId.substring(0, artifactId.length() - 10) : artifactId;
}
supernova.jacoco.skipCheck = getOrDefault(properties, "supernova.jacoco.skipCheck", nonAggregateChildSupplier);
</source>
</configuration>
</execution>
<execution>
<id>list-supernova-properties-validate</id>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<source>
import java.util.Map.Entry;
for (Entry entry : new TreeMap(project.getProperties()).entrySet()) {
String key = entry.getKey().toString();
if (key.startsWith("supernova.")) {
log.info(key + " = " + entry.getValue());
}
}
</source>
</configuration>
</execution>
<execution>
<id>define-supernova-properties-pre-clean</id>
<!-- Ideally, we need one "bsh-property" goal for all purposes, and we need it early in the lifecycle. -->
<!-- For the default lifecycle, this is the default "validate" phase. -->
<!-- For the "clean" lifecycle, this is the "pre-clean" phase (because it doesn't have a "validate" phase). -->
<!-- Unfortunately, this means we cannot define a single execution bound to a common phase. -->
<!-- We have to define multiple executions bound to different phases, with some inevitable code duplication. -->
<!-- Pity, but we accept the cost and move on. -->
<phase>pre-clean</phase>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<properties>
<property>supernova.jacoco.skipDeleteSources</property>
</properties>
<source>
import java.io.File;
import java.util.function.Supplier;
boolean getOrDefault(Properties properties, String name, Supplier supplier) {
String value = properties.getProperty(name);
if (value == null) {
return (Boolean) supplier.get();
}
return Boolean.parseBoolean(value);
}
properties = project.getProperties();
parent = project.getParent();
supernova.multiModule.child = (parent != null) && parent.getArtifactId().endsWith("-parent");
supernova.multiModule.aggregate = supernova.multiModule.child && project.getArtifactId().endsWith("-aggregate");
// Unfortunately, BeanShell does not support lambdas, so we have to spell out an anonymous inner class.
aggregateChildSupplier = new Supplier() {
Boolean get() {
return !supernova.multiModule.child || !supernova.multiModule.aggregate;
}
};
supernova.jacoco.skipDeleteSources = getOrDefault(properties, "supernova.jacoco.skipDeleteSources", aggregateChildSupplier);
</source>
</configuration>
</execution>
<execution>
<id>list-supernova-properties-pre-clean</id>
<phase>pre-clean</phase>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<source>
import java.util.Map.Entry;
for (Entry entry : new TreeMap(project.getProperties()).entrySet()) {
String key = entry.getKey().toString();
if (key.startsWith("supernova.")) {
log.info(key + " = " + entry.getValue());
}
}
</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<!-- The ID must match the ID of the default goal, because we want to reconfigure it. -->
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<!-- Don't produce an artifact of type "jar" if main/src is empty. -->
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
<!-- Don't produce an artifact of type "test-jar" if test/src is empty. -->
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</execution>
<execution>
<id>integration-verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
<!--
Given that we flatten the pom, it is useful to have the source pom.xml in the sources.
Especially for projects of packaging type "pom", for which it will be the ONLY file in the sources.
-->
<configuration>
<includePom>true</includePom>
</configuration>
</execution>
<execution>
<id>attach-test-sources</id>
<goals>
<goal>test-jar-no-fork</goal>
</goals>
<!-- The pom is already in the main sources jar, no need to include it here again. -->
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<excludePackageNames>*.internal.*</excludePackageNames>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
<passphraseServerId>${gpg.server}</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<updatePomFile>true</updatePomFile>
<!--
This parent POM should flatten as little as possible, to keep its BOM nature and pass on its
properties to its children.
Child POMs should flatten as much as possible, to avoid cluttering the public POM with
build-specific information.
-->
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten-flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
The JaCoCo configuration supports single-module and multi-module projects, combining coverage of unit and
integration tests.
All Supernova projects must achieve 100% code coverage, hence the default ${jacoco.coverage.minimum} = 1.00.
Within a single module, code coverage of unit and integration tests is aggregated by using the same
destination file as set by ${jacoco.destFile}.
In multi-module projects, 100% code coverage may not be achieved in each of the individual modules,
but may be achieved by aggregating the code coverage of all the modules:
- my-project (main module, tests in this module alone do not reach 100% code coverage, lower the
${jacoco.coverage.minimum} or skip the check in those modules)
- [optional] my-project-extras (additional module)
- my-project-tests (additional module with tests, reaching 100% code coverage)
- my-project-aggregate (aggregate module combining the JaCoCo report for all other modules to achieve 100%
code coverage)
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<destFile>${project.build.directory}/${project.artifactId}-ut.exec</destFile>
</configuration>
</execution>
<execution>
<id>jacoco-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<skip>${skipITs}</skip>
<destFile>${project.build.directory}/${project.artifactId}-it.exec</destFile>
</configuration>
</execution>
<execution>
<id>jacoco-merge</id>
<!-- It must come AFTER integration tests, but BEFORE the "check" goal, so we bind it to the same phase as the "check" goal but higher up in the POM so that it comes first. -->
<phase>verify</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>*.exec</include>
</includes>
</fileSet>
</fileSets>
<skip>${supernova.jacoco.skipMerge}</skip>
<destFile>${project.build.directory}/${project.artifactId}.exec</destFile>
</configuration>
</execution>
<!-- Use a single "report" goal to report on a single exec file which is the combined coverage of unit and integration tests. -->
<execution>
<id>jacoco-report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<skip>${supernova.jacoco.skipReport}</skip>
<dataFile>${project.build.directory}/${project.artifactId}.exec</dataFile>
<formats>HTML</formats>
<title>${supernova.jacoco.reportTitle}</title>
</configuration>
</execution>
<!-- <!– Use a "report-aggregate" goal for multi-module aggregator projects. –>-->
<!-- <execution>-->
<!-- <id>jacoco-report-aggregate</id>-->
<!-- <phase>verify</phase>-->
<!-- <goals>-->
<!-- <goal>report-aggregate</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <skip>${supernova.jacoco.skipReportAggregate}</skip>-->
<!-- <formats>HTML</formats>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- <!– Across multiple modules of a multi-module project, merges *.exec into *-aggregate.exec. –>-->
<!-- <execution>-->
<!-- <id>jacoco-merge</id>-->
<!-- <goals>-->
<!-- <goal>merge</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <skip>${supernova.jacoco.skipMerge}</skip>-->
<!-- <fileSets>-->
<!-- <fileSet>-->
<!-- <directory>${supernova.jacoco.destDir}</directory>-->
<!-- <includes>-->
<!-- <include>*.exec</include>-->
<!-- </includes>-->
<!-- </fileSet>-->
<!-- </fileSets>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- No need to have a separate report-integration goal, since both unit and integration test coverage has been appended to the same file and thus covered by the report goal. -->
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<skip>${supernova.jacoco.skipCheck}</skip>
<dataFile>${project.build.directory}/${project.artifactId}.exec</dataFile>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.coverage.minimum}</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.coverage.minimum}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-sources-to-aggregate</id>
<phase>verify</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<skip>${supernova.jacoco.skipCopyResources}</skip>
<outputDirectory>${supernova.multiModule.aggregateDir}/src/main/java</outputDirectory>
<resources>
<resource>
<directory>${project.build.sourceDirectory}</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-resources-to-aggregate</id>
<phase>verify</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<skip>${supernova.jacoco.skipCopyResources}</skip>
<outputDirectory>${supernova.multiModule.aggregateDir}/target</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<includes>
<!-- Copy production classes to aggregate. -->
<!-- Skip test classes because they don't need coverage. -->
<include>classes/**/*.class</include>
<include>${project.artifactId}.exec</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<!-- Always install at the end of a multi-module build. -->
<!-- This gives the aggregate project a chance to fail the build before installation, for example because coverage checks have not been met. -->
<installAtEnd>true</installAtEnd>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>delete-sources-from-aggregate</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<skip>${supernova.jacoco.skipDeleteSources}</skip>
<filesets>
<fileset>
<directory>${project.build.sourceDirectory}</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<!-- The nexus-staging-maven-plugin replaces the maven-deploy-plugin. -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<!--
Below is necessary to make sure deploy happens for every module of a multi-module build.
Without it, deployment happens at the end, in the last module, and if the last module skips
deployment, nothing is deployed at all.
-->
<!-- <skipLocalStaging>true</skipLocalStaging>-->
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-no-snapshots-in-releases</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireReleaseDeps>
<onlyWhenRelease>true</onlyWhenRelease>
<failWhenParentIsSnapshot>true</failWhenParentIsSnapshot>
<message>No snapshots allowed in release!</message>
</requireReleaseDeps>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- <reporting>-->
<!--
Usage of plugin together with maven-site-plugin without explicit selection of reports might lead to generation of redundant aggregate reports.
Specify reportSets explicitly to avoid this.
-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.jacoco</groupId>-->
<!-- <artifactId>jacoco-maven-plugin</artifactId>-->
<!-- <reportSets>-->
<!-- <reportSet>-->
<!-- <reports>-->
<!-- <!– Select non-aggregate reports. –>-->
<!-- <report>report</report>-->
<!-- </reports>-->
<!-- </reportSet>-->
<!-- </reportSets>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </reporting>-->
</project>