Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
290 lines (269 loc) · 10.9 KB
/
Copy pathpom.xml
File metadata and controls
290 lines (269 loc) · 10.9 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
<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>com.voxgig</groupId>
<artifactId>struct-java</artifactId>
<version>0.1.1</version>
<name>voxgig-struct-java</name>
<description>Voxgig Struct — utilities for transforming JSON-like data structures (Java port).</description>
<url>https://github.com/voxgig/struct</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>voxgig</id>
<name>Voxgig</name>
<organization>Voxgig</organization>
<organizationUrl>https://voxgig.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/voxgig/struct.git</connection>
<developerConnection>scm:git:[email protected]:voxgig/struct.git</developerConnection>
<url>https://github.com/voxgig/struct</url>
</scm>
<!-- Publishing goes through the Sonatype Central Portal via the
central-publishing-maven-plugin (see the `release` profile) — NOT the
legacy OSSRH/Nexus staging API, which Sonatype shut down on 2025-06-30.
The plugin uploads the bundle to the Portal; there is no
distributionManagement repository. Portal user-token credentials
(server id = central) come from a settings.xml at release time. -->
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.jupiter.version>6.1.0</junit.jupiter.version>
<gson.version>2.14.0</gson.version>
<checkstyle.plugin.version>3.6.0</checkstyle.plugin.version>
<checkstyle.version>13.5.0</checkstyle.version>
<spotbugs.plugin.version>4.9.8.3</spotbugs.plugin.version>
<central.publishing.plugin.version>0.11.0</central.publishing.plugin.version>
</properties>
<dependencies>
<!-- Gson is used ONLY by the test harness (corpus loading + assertion
diffs). The library proper has no third-party JSON dependency. -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<excludes>
<exclude>test/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<useModulePath>false</useModulePath>
</configuration>
</plugin>
<!-- Code quality: Checkstyle (style) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
<configuration>
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<violationSeverity>warning</violationSeverity>
</configuration>
<executions>
<execution>
<id>checkstyle</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Code quality: SpotBugs (bug pattern detection) -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<configuration>
<effort>Max</effort>
<threshold>Medium</threshold>
<includeTests>false</includeTests>
<excludeFilterFile>${project.basedir}/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
<executions>
<execution>
<id>spotbugs</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- The shared test runner, voxgig/omni, consumed as a local checkout: it
is not published to Maven Central. `make test` builds its jar, installs
it into the local repository (see `setup-omni`) and activates this
profile, so it resolves like any other test-scoped dependency.
Two things it is deliberately NOT:
Not `system` scope, the obvious shortcut. A system-scoped dependency
sits on the COMPILE classpath, so omni would reach the library's own
build and its published POM - the leak register 4.13 is about.
Not an unconditional test-scoped dependency either, which is where
this started. Test scope keeps omni off consumers' classpaths, but
the coordinate still sits in the POM, and anything that resolves the
POM statically - osv-scanner's transitive dependency scan, for one -
goes looking for com.voxgig:omni:0.1.0 on Central and fails hard:
failed resolving {Maven:com.voxgig:struct-java[Concrete:0.1.0]}:
version Maven:com.voxgig:omni[Concrete:0.1.0]: not found
An inactive profile is invisible to that resolution. `mvn test` on its
own now fails to COMPILE the test sources ("package voxgig.omni does
not exist"); use `make test`, which passes -Pomni. -->
<profile>
<id>omni</id>
<dependencies>
<dependency>
<groupId>com.voxgig</groupId>
<artifactId>omni</artifactId>
<version>0.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<!-- Release profile: attaches the sources + javadoc jars (required by
Maven Central) and signs all artifacts with GPG. Signing is bound to
the `verify` phase, so a plain `mvn -Prelease package` produces the
three jars WITHOUT needing a GPG key; the key is only required once
the build reaches `verify`/`deploy` (see the Makefile `publish`
target). The GPG key + passphrase are operator-provided at release. -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<!-- Test sources physically live under src/test (same source
dir as the library); keep them out of the published jar. -->
<excludes>
<exclude>test/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<!-- The ported source is large/dense; relax doclint and never
fail the build on javadoc warnings so the jar still builds. -->
<doclint>none</doclint>
<failOnError>false</failOnError>
<!-- Exclude the test sources (they share the voxgig.struct
package but sit in src/test and pull in test-scope deps),
so javadoc documents only the library API. -->
<sourceFileExcludes>
<sourceFileExclude>test/**</sourceFileExclude>
</sourceFileExcludes>
</configuration>
<executions>
<execution>
<id>attach-javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<configuration>
<!-- Headless signing: read the passphrase from the environment
(MAVEN_GPG_PASSPHRASE) and drive gpg with loopback pinentry
so it never prompts on a TTY. -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<!-- verify (not package) so `package` does NOT require a key. -->
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Upload + release to the Sonatype Central Portal (replaces the
retired OSSRH staging API). autoPublish=true releases without a
manual gate; waitUntil=published blocks until Central finishes
so a failed release fails the build (and we never tag). The
`central` server token comes from the release settings.xml. -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>