-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpom.xml
More file actions
439 lines (414 loc) · 21.6 KB
/
Copy pathpom.xml
File metadata and controls
439 lines (414 loc) · 21.6 KB
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
<?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.postgresql</groupId>
<artifactId>postgresql-client-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>postgresql-client (parent)</name>
<description>A modern, PostgreSQL-specific database driver for the JVM.</description>
<licenses>
<license>
<name>The PostgreSQL License</name>
<url>https://opensource.org/license/postgresql</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>postgresql-client-protocol</module>
<module>postgresql-client</module>
<module>postgresql-client-jdbc</module>
<module>postgresql-client-pgjdbc-compat</module>
<module>postgresql-client-bench</module>
<module>postgresql-client-bench-jmh</module>
<module>postgresql-client-coverage</module>
<module>postgresql-client-native-smoke</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.release>21</maven.compiler.release>
<!-- Reproducible builds (N7.1 / C24.8): a fixed timestamp makes archive entries
(JAR manifests, class file dates) byte-for-byte stable across rebuilds. Maven's
archiver plugins honor this property automatically. Release engineering bumps it
per release (e.g. to the release commit date). -->
<project.build.outputTimestamp>2026-01-01T00:00:00Z</project.build.outputTimestamp>
<!-- Build prerequisites enforced by maven-enforcer-plugin. -->
<minimum.maven.version>3.8.0</minimum.maven.version>
<minimum.java.version>21</minimum.java.version>
<!-- Plugin versions -->
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.5.2</maven-failsafe-plugin.version>
<maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
<spotless-maven-plugin.version>3.7.0</spotless-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
<!-- GraalVM native-image smoke gate (postgresql-client-native-smoke, native-smoke profile). -->
<native-maven-plugin.version>0.10.0</native-maven-plugin.version>
<exec-maven-plugin.version>3.5.0</exec-maven-plugin.version>
<!-- Static analysis (build-time only; never in the shipped artifacts). NullAway needs
Error Prone as its carrier; see docs/static-analysis.md for why these two and not
the rest. jspecify supplies @Nullable/@NullMarked and is provided-scope: the
annotations are CLASS-retention, so they are absent at runtime. -->
<errorprone.version>2.36.0</errorprone.version>
<nullaway.version>0.12.3</nullaway.version>
<jspecify.version>1.0.0</jspecify.version>
<!-- Runtime dependency versions (manually vetted; see docs/dependencies.md).
Declared here for governance even before a module consumes them. -->
<scram.version>3.4</scram.version>
<slf4j.version>2.0.17</slf4j.version>
<!-- Test dependency versions -->
<junit.version>5.11.4</junit.version>
<testcontainers.version>1.20.6</testcontainers.version>
<!-- Benchmark-tool (postgresql-client-bench) dependency versions. The bench module is a
build-only, non-published CLI app (like postgresql-client-coverage); these are not shipped
in the driver artifacts. See docs/dependencies.md and docs/plans/jdbc-bench-module.md. -->
<picocli.version>4.7.6</picocli.version>
<hdrhistogram.version>2.2.2</hdrhistogram.version>
<!-- Docker Engine API version the integration-test JVM advertises to the daemon.
1.41 is supported by every Docker since 2021 and satisfies modern daemons that
reject docker-java's stale 1.32 default. See the failsafe config below. -->
<docker.api.version>1.41</docker.api.version>
</properties>
<dependencies>
<!-- Nullness annotations, everywhere. Provided scope and CLASS retention, so this adds
nothing to the runtime graph of a consumer (docs/dependencies.md). -->
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${jspecify.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!-- Internal modules: keep versions aligned across the reactor. -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql-client-protocol</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql-client-jdbc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql-client-pgjdbc-compat</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Runtime deps: SCRAM auth (Phase 8) and the SLF4J logging API (Phase 22).
Managed here so versions stay aligned; modules opt in as they need them. -->
<dependency>
<groupId>com.ongres.scram</groupId>
<artifactId>scram-client</artifactId>
<version>${scram.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Testcontainers BOM: aligns the Testcontainers module tree so the
enforcer's dependencyConvergence rule stays satisfied (ADR-0002/0003).
Integration-only; modules opt in at test scope (C0.10). -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<!-- Benchmark-tool deps (postgresql-client-bench only; not shipped in the driver). -->
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>${picocli.version}</version>
</dependency>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
<version>${hdrhistogram.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<showWarnings>true</showWarnings>
<compilerArgs>
<!-- this-escape fires on constructors of final classes, where the hazard it
warns about (a subclass observing a partly-built object) cannot
occur. Everything else is on, and Werror keeps it at zero. -->
<arg>-Xlint:all,-this-escape</arg>
<arg>-Werror</arg>
<!-- Error Prone is here only to carry NullAway: every one of its own
checks is off via XepDisableAllChecks. Adopting them is a separate
decision (docs/static-analysis.md) and a separate backlog. -->
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepDisableAllChecks -Xep:NullAway:ERROR
-XepOpt:NullAway:AnnotatedPackages=org.postgresql.client.protocol,org.postgresql.client.core
-XepOpt:NullAway:ExcludedFieldAnnotations=org.junit.jupiter.api.io.TempDir</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${errorprone.version}</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${nullaway.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Fail the build early on environment/dependency hygiene problems. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-build-hygiene</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${minimum.maven.version},)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[${minimum.java.version},)</version>
</requireJavaVersion>
<!-- Ban convergent/duplicate dependency versions (ADR-0002). -->
<dependencyConvergence/>
<banDuplicatePomDependencyVersions/>
<reactorModuleConvergence/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Make the jdk.jfr module visible to TEST compilation only: the virtual-thread
non-pinning IT (N1.7) reads jdk.VirtualThreadPinned events, but jdk.jfr is not in
the default root module set for classpath compilation. Scoped to default-testCompile
so main modules (which have module-info) are unaffected; the matching runtime flag
is on the failsafe argLine in the integration-tests profile. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<compilerArgs>
<arg>--add-modules</arg>
<arg>jdk.jfr</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
<!-- Enforce consistent Java formatting (palantir = 4-space, matching the
project convention); bound to verify so a plain compile is unaffected.
Run `mvn spotless:apply` to fix. The ASCII-only source policy (C0.8) is gated
by AsciiSourcePolicyTest, which runs in the normal test phase. -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<java>
<palantirJavaFormat/>
<trimTrailingWhitespace/>
<endWithNewline/>
</java>
</configuration>
<executions>
<execution>
<id>spotless-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Code coverage: the JaCoCo agent instruments the unit-test JVM (prepare-agent
wires its javaagent into surefire's argLine) and a per-module HTML/XML report
is written to target/site/jacoco/ at the test phase. Inherited by every module;
integration-test coverage is added under the integration-tests profile below. -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<!-- Coverage gate (C24.4/N1.9): fail the build if a module's unit coverage
regresses below a modest floor. Set as a per-BUNDLE tripwire well under
the current weakest module, not an aspirational bar; raise as coverage
grows. Runs at verify against the test-phase jacoco.exec (no Docker). -->
<execution>
<id>jacoco-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.20</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.20</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Integration tests (Testcontainers, real PostgreSQL) run only under this
profile so a plain `mvn test` needs no Docker (ADR-0003). -->
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<!-- The docker-java client bundled with Testcontainers pins its
API version to 1.32 by default, which modern Docker daemons
(Engine 25+, minimum API 1.40) reject with "client version is
too old". docker-java reads this only from the `api.version`
system property (it has no DOCKER_API_VERSION env support), so
it must be set on the forked test JVM. Override per Docker
version with -Ddocker.api.version=... in CI if needed. -->
<systemPropertyVariables>
<api.version>${docker.api.version}</api.version>
</systemPropertyVariables>
<!-- Resolve jdk.jfr and let the patched test module read it for the
non-pinning IT (N1.7); failsafe patches test classes into
org.postgresql.client.core, which does not `requires jdk.jfr`.
@{argLine} preserves the JaCoCo integration agent's argLine. -->
<argLine>@{argLine} --add-modules jdk.jfr
--add-reads org.postgresql.client.core=jdk.jfr</argLine>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Integration-test coverage: prepare-agent-integration wires the JaCoCo
agent into failsafe's forked JVM and report-integration writes a separate
per-module report to target/site/jacoco-it/ during the verify phase. Kept
out of the default build so a plain `mvn test` needs no Docker (ADR-0003). -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-report-integration</id>
<phase>verify</phase>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>