-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
283 lines (257 loc) · 13.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
<!--
~ Copyright (c) 2022 Michael Belivanakis a.k.a. MikeNakis, michael.gr
~
~ For licensing information, please see LICENSE.md.
~ You may not use this file except in compliance with the license.
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.mikenakis</groupId>
<artifactId>bathyscaphe-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>main</module>
<module>test</module>
</modules>
<name>BathyscapheParent</name>
<description>Deep immutability assessment for Java objects.</description>
<url>https://github.com/mikenakis/Bathyscaphe</url>
<licenses>
<license>
<name>Dual license (See LICENSE.md)</name>
<url>https://github.com/mikenakis/Bathyscaphe/blob/master/LICENSE.md</url>
<distribution>repo</distribution>
</license>
</licenses>
<inceptionYear>2022</inceptionYear>
<developers>
<developer>
<id>michael.gr</id>
<name>Mike Nakis</name>
<email>pom.xml@michael.gr</email>
<organization>michael.gr</organization>
<organizationUrl>http://michael.gr</organizationUrl>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<url>https://github.com/mikenakis/Bathyscaphe.git</url>
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- <maven.compiler.source>17</maven.compiler.source>-->
<!-- <maven.compiler.target>17</maven.compiler.target>-->
<!-- Due to the use of preview features, we must target the latest JDK, even though we could have worked with JDK 17. -->
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.target>19</maven.compiler.target>
</properties>
<distributionManagement>
<!-- <repository>-->
<!-- <id>github-bathyscaphe</id>-->
<!-- PEARL: In the 'mikenakis/Bathyscaphe' part, there be magic: in GitHub, the name of the artifact repository must match the name of the source code repository. -->
<!-- <url>https://maven.pkg.github.com/mikenakis/Bathyscaphe</url>-->
<!-- </repository>-->
<repository>
<id>repsy-mikenakis-public</id>
<url>https://repo.repsy.io/mvn/mikenakis/mikenakis-public</url>
</repository>
<snapshotRepository>
<id>repsy-mikenakis-public</id>
<url>https://repo.repsy.io/mvn/mikenakis/mikenakis-public</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<doclint>none</doclint>
<!-- PEARL: the maven-javadoc-plugin must be told separately that JDK preview features are enabled, dog knows why. -->
<additionalOptions>--enable-preview</additionalOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<!-- magical incantations from https://github.com/gh-a-sample/github-actions-maven-release-sample -->
<scmCommentPrefix>[ci skip]</scmCommentPrefix>
<tagNameFormat>@{project.version}</tagNameFormat>
<!-- do not run any tests when releasing. Normal build should have taken care of that. -->
<arguments>-Dmaven.test.skip</arguments>
<!-- allow the release to proceed despite local modifications. Can be useful while troubleshooting. -->
<!-- <checkModificationExcludes>-->
<!-- <checkModificationExclude>**</checkModificationExclude>-->
<!-- </checkModificationExcludes>-->
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerArgs>
<!-- The "enable-preview" option "Enables preview features of the JVM". Since home projects of mine are all about experimentation, we want this. -->
<arg>--enable-preview</arg>
<!-- The "-parameters" option "Generates metadata for reflection on method parameters." That's good, we want this. -->
<arg>-parameters</arg>
<!-- If there are any warnings, we want compilation to fail. I pity all those who a) don't have as many as possible warnings enabled, and b) don't have
their build configured to treat warnings as errors. -->
<arg>-Werror</arg>
<!-- The "-Xlint" option enables all recommended warnings. We will then suppress some that we have no use for. -->
<arg>-Xlint</arg>
<!-- The "preview" sub-option of the "Xlint" option will generate a warning for each use of a preview feature. Since we are explicitly enabling preview
features using the "enable-preview" compiler argument, this sub-option is entirely useless, so we disable it. -->
<arg>-Xlint:-preview</arg>
<!-- The "try" sub-option of the "Xlint" option is mind-bogglingly stupid.
It lives in a simplistic world in which resources are always created, used, and disposed within a single function, so it aims to warn you that you
forgot to dispose of a resource within the function that created it.
The following possibilities never occurred to the mastermind who invented this option:
- You might invoke a function which creates a resource and returns it, to be used and of course disposed by the caller.
- You might create a resource and store it as a member variable of an object, which will of course dispose the resource when it gets disposed.
So, the only reasonable thing to do with this warning is to always keep it disabled. -->
<arg>-Xlint:-try</arg>
<!-- The "serial" sub-option of the "Xlint" option "Warns about missing serialVersionUID definitions on serializable classes".
In other words, every single time you extend some predefined class, you will be hit with an annoying warning just because the class you are extending
happens to be serializable, a feature which you usually have no use for, don't care about, and don't want to be bothered with. -->
<arg>-Xlint:-serial</arg>
<!-- PEARL: When the packaging is 'jar', IntellijIdea creates a "target/generated-sources/annotations" directory in our source tree each time we build.
IntellijIdea insists on doing this, despite the fact that:
- We have specified that we do not want any annotation processing to take place. (In this case, the directory still gets created, and is empty.)
- We have specified that our output folder is something other than 'target'. (IntellijIdea will nonetheless create a directory called 'target'.)
This is related to some other very strange behavior of IntellijIdea: if you go to Settings... / Build, Execution, Deployment / Compiler / Annotation
Processors you will find that the 'Enable annotation processing' checkbox is unchecked. However, as it turns out, this only applies to the mysterious,
nonsensical 'Default' branch of the mysterious, nonsensical tree that appears to the left of the checkbox. If you scroll down that tree, you will
discover that there are more branches, and for those branches 'Enable annotation processing' is checked, and the "target/generated-sources/annotations"
directory is specified. I have no idea how or why IntellijIdea creates those branches, and why it configures them like that. The only way I have found
to prevent all that nonsense from affecting the directories created is by explicitly disabling annotation processing here, with -proc:none.
PEARL on PEARL: the use of this option causes the following message to appear in the build window of IntellijIdea:
java: User-specified option "-proc:none" is ignored for "<project>". This compilation parameter is set automatically according to project settings.
Still, I would rather have this silly warning appear during build, than have weird empty extra target folders created.
- Note that the 'java:' prefix suggests that this message is issued by the java compiler, while in fact it is issued by IntellijIdea.
- Note that -Xlint:-processing does not help at all in suppressing this warning.
- Note that contrary to what the warning message says, the -proc:none option is not ignored, because the annoying directories are not created. -->
<arg>-proc:none</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<configuration>
<!-- PEARL: maven-surefire-plugin by default emits output to some secret file.
By default, the maven-surefire-plugin emits all test output to some file instead of the console. Furthermore, one must go chasing documentation to
discover what the filename might be, which essentially means that it is a secret filename.
The following magical incantation fixes this. -->
<useFile>false</useFile>
<!-- PEARL: maven-surefire-plugin by default trims stack traces.
When an exception is thrown by the tests, the maven-surefire-plugin will only show the top frame from the exception stack trace, which is entirely
useless for all but the most trivial scenarios. As someone aptly put it on stackoverflow, "Yep. Not only does Maven print pages of pointless
diarrhea, but it hides what you actually need to see."
The following magical incantation reverses this behavior. (From https://stackoverflow.com/a/16941432/773113) -->
<trimStackTrace>false</trimStackTrace>
<!-- PEARL: maven-surefire-plugin by default uses unworkable (and secret) "inclusions" and "exclusions".
The maven-surefire-plugin has some entirely useless concepts of "inclusions" and "exclusions", and the defaults are such that absolutely none of
your tests will run unless they adhere to some convention. Furthermore, one must go chasing documentation to discover what the convention might be,
which essentially means that it is a secret convention. (By the way, the secret convention is that the class name must contain the word "Test".)
We correct this problem here by annihilating the plugin's concept of inclusions. -->
<includes>
<include>**/*.java</include>
</includes>
<!-- PEARL: the maven-surefire-plugin must be told separately that JDK preview features are enabled, dog knows why. -->
<argLine>--enable-preview</argLine>
<!-- PEARL: additional magical incantation needed for the enable-preview option to work. (From https://stackoverflow.com/a/69754577/773113) -->
<reuseForks>true</reuseForks>
<!-- PEARL: maven-surefire-plugin requires to be separately told what the source file encoding is.
Otherwise, tests that contain unicode characters will fail, despite the fact that the project.build.sourceEncoding property has been set to UTF8.
The following magical incantation fixes this. (From https://stackoverflow.com/a/17671104/773113) -->
<encoding>${project.build.sourceEncoding}</encoding>
<!-- PEARL: the test output renders unicode characters as question-marks, and I have been unable to fix this.
I have tried project.reporting.outputEncoding, -Dconsole.encoding=UTF-8 -Dfile.encoding=UTF-8 etc. nothing works. -->
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
<!-- <version>3.0.1</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>sign-artifacts</id>-->
<!-- <phase>verify</phase>-->
<!-- <goals>-->
<!-- <goal>sign</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <version>1.6.7</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <serverId>ossrh</serverId>-->
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>
<repositories>
<!-- <repository>-->
<!-- <id>github-bathyscaphe-claims</id>-->
<!-- <url>https://maven.pkg.github.com/mikenakis/BathyscapheClaims</url>-->
<!-- <releases>-->
<!-- <enabled>true</enabled>-->
<!-- </releases>-->
<!-- </repository>-->
<repository>
<id>repsy-mikenakis-public</id>
<url>https://repo.repsy.io/mvn/mikenakis/mikenakis-public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>