blob: fc6f3983990aec28d6f2d02c9423730e79dbf8d4 [file] [log] [blame]
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +01001<?xml version="1.0"?>
Matthias Andreas Benkard279fca62026-08-23 08:32:08 +02002<!-- SPDX-FileCopyrightText: 2020 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
3 SPDX-License-Identifier: AGPL-3.0-or-later -->
Matthias Andreas Benkard545aeb62020-12-06 15:16:22 +01004<project
5 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
6 xmlns="http://maven.apache.org/POM/4.0.0"
7 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +01008
9 <modelVersion>4.0.0</modelVersion>
10
11 <groupId>eu.mulk</groupId>
12 <artifactId>aendggner</artifactId>
13 <version>${revision}</version>
14
15 <properties>
16 <maven.compiler.parameters>true</maven.compiler.parameters>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020017 <maven.compiler.release>21</maven.compiler.release>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010018
19 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
21
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020022 <enforced.maven-version>3.9.0</enforced.maven-version>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010023
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +020024 <build-helper-plugin.version>3.6.0</build-helper-plugin.version>
Matthias Andreas Benkardf3b47af2026-08-22 21:23:06 +020025 <clean-plugin.version>3.3.2</clean-plugin.version>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020026 <compiler-plugin.version>3.15.0</compiler-plugin.version>
27 <dependency-plugin.version>3.11.0</dependency-plugin.version>
28 <enforcer-plugin.version>3.6.3</enforcer-plugin.version>
29 <exec-plugin.version>3.6.3</exec-plugin.version>
30 <jar-plugin.version>3.5.0</jar-plugin.version>
31 <resources-plugin.version>3.5.0</resources-plugin.version>
32 <spotless-plugin.version>3.8.0</spotless-plugin.version>
33 <surefire-plugin.version>3.5.6</surefire-plugin.version>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010034
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020035 <google.java.format.version>1.28.0</google.java.format.version>
36
37 <assertj.version>3.27.7</assertj.version>
38 <java-diff-utils.version>4.17</java-diff-utils.version>
39 <jboss-logging.version>3.6.3.Final</jboss-logging.version>
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +020040 <jzlib.version>1.1.5</jzlib.version>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020041 <jspecify.version>1.0.0</jspecify.version>
42 <junit.version>5.13.4</junit.version>
43 <pdfbox.version>3.0.8</pdfbox.version>
44 <picocli.version>4.7.7</picocli.version>
45 <slf4j.version>2.0.18</slf4j.version>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010046 </properties>
47
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020048 <dependencyManagement>
49 <dependencies>
50 <dependency>
51 <groupId>org.junit</groupId>
52 <artifactId>junit-bom</artifactId>
53 <version>${junit.version}</version>
54 <type>pom</type>
55 <scope>import</scope>
56 </dependency>
57 </dependencies>
58 </dependencyManagement>
59
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010060 <dependencies>
61
62 <!-- Annotations -->
63 <dependency>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020064 <groupId>org.jspecify</groupId>
65 <artifactId>jspecify</artifactId>
66 <version>${jspecify.version}</version>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010067 </dependency>
68
Matthias Andreas Benkard31a2c502020-11-22 14:36:27 +010069 <!-- Command line parsing -->
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +010070 <dependency>
71 <groupId>info.picocli</groupId>
72 <artifactId>picocli</artifactId>
73 <version>${picocli.version}</version>
74 </dependency>
75
Matthias Andreas Benkard545aeb62020-12-06 15:16:22 +010076 <!-- Logging -->
77 <dependency>
78 <groupId>org.jboss.logging</groupId>
79 <artifactId>jboss-logging</artifactId>
80 <version>${jboss-logging.version}</version>
81 </dependency>
Matthias Andreas Benkard545aeb62020-12-06 15:16:22 +010082 <dependency>
83 <groupId>org.slf4j</groupId>
84 <artifactId>slf4j-jdk14</artifactId>
85 <version>${slf4j.version}</version>
86 </dependency>
87 <dependency>
88 <groupId>org.slf4j</groupId>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020089 <artifactId>jcl-over-slf4j</artifactId>
Matthias Andreas Benkard545aeb62020-12-06 15:16:22 +010090 <version>${slf4j.version}</version>
91 </dependency>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020092
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020093 <!-- PDF text extraction -->
Matthias Andreas Benkard31a2c502020-11-22 14:36:27 +010094 <dependency>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +020095 <groupId>org.apache.pdfbox</groupId>
96 <artifactId>pdfbox</artifactId>
97 <version>${pdfbox.version}</version>
98 </dependency>
99
100 <!-- Text diffing -->
101 <dependency>
102 <groupId>io.github.java-diff-utils</groupId>
103 <artifactId>java-diff-utils</artifactId>
104 <version>${java-diff-utils.version}</version>
105 </dependency>
106
107 <!-- Testing -->
108 <dependency>
109 <groupId>org.junit.jupiter</groupId>
110 <artifactId>junit-jupiter</artifactId>
111 <scope>test</scope>
Matthias Andreas Benkard31a2c502020-11-22 14:36:27 +0100112 </dependency>
113 <dependency>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +0200114 <groupId>org.assertj</groupId>
115 <artifactId>assertj-core</artifactId>
116 <version>${assertj.version}</version>
117 <scope>test</scope>
Matthias Andreas Benkard31a2c502020-11-22 14:36:27 +0100118 </dependency>
119
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100120 </dependencies>
121
122 <build>
123
Matthias Andreas Benkard545aeb62020-12-06 15:16:22 +0100124 <resources>
125 <resource>
126 <directory>src/main/resources</directory>
127 </resource>
128 </resources>
129
Matthias Andreas Benkardf3b47af2026-08-22 21:23:06 +0200130 <!--
131 Der Beispielkorpus liegt unter src/test/resources, wird aber von den Tests über
132 Dateisystempfade gelesen, nicht über den Klassenpfad. Eine Kopie nach
133 target/test-classes wäre deshalb bei jedem Bau 35 MB umsonst.
134 -->
135 <testResources>
136 <testResource>
137 <directory>src/test/resources</directory>
138 <excludes>
139 <exclude>sampledata/**</exclude>
140 </excludes>
141 </testResource>
142 </testResources>
143
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100144 <pluginManagement>
145 <plugins>
146
147 <plugin>
148 <groupId>org.codehaus.mojo</groupId>
149 <artifactId>versions-maven-plugin</artifactId>
150 <configuration>
151 <generateBackupPoms>false</generateBackupPoms>
152 </configuration>
153 </plugin>
154
155 </plugins>
156 </pluginManagement>
157
158 <plugins>
159
160 <!-- Compiler -->
161 <plugin>
162 <artifactId>maven-compiler-plugin</artifactId>
163 <version>${compiler-plugin.version}</version>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100164 <configuration>
165 <annotationProcessorPaths>
166 <path>
167 <groupId>info.picocli</groupId>
168 <artifactId>picocli-codegen</artifactId>
169 <version>${picocli.version}</version>
170 </path>
171 </annotationProcessorPaths>
172 <compilerArgs>
173 <arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
174 </compilerArgs>
175 </configuration>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100176 </plugin>
177
178 <!-- Resources -->
179 <plugin>
180 <artifactId>maven-resources-plugin</artifactId>
181 <version>${resources-plugin.version}</version>
182 </plugin>
183
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +0200184 <!-- Tests -->
185 <plugin>
186 <artifactId>maven-surefire-plugin</artifactId>
187 <version>${surefire-plugin.version}</version>
188 </plugin>
189
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100190 <!-- Google Java Code Formatter, for enforcing style conventions -->
191 <plugin>
192 <groupId>com.diffplug.spotless</groupId>
193 <artifactId>spotless-maven-plugin</artifactId>
194 <version>${spotless-plugin.version}</version>
195 <configuration>
196 <java>
Matthias Andreas Benkard279fca62026-08-23 08:32:08 +0200197 <!-- src/wasm/java tritt dem Quellbaum erst im Profil -Pwasm bei; damit die
198 beiden Wasm-Klassen dennoch stets mitgeprüft werden, sind die
199 Quellverzeichnisse hier ausdrücklich benannt. -->
200 <includes>
201 <include>src/*/java/**/*.java</include>
202 </includes>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100203 <removeUnusedImports/>
204 <importOrder>
205 <order>java,javax,org,com,de,io,dagger,eu.mulk,</order>
206 </importOrder>
207 <googleJavaFormat>
208 <version>${google.java.format.version}</version>
209 <style>GOOGLE</style>
210 </googleJavaFormat>
Matthias Andreas Benkard279fca62026-08-23 08:32:08 +0200211 <licenseHeader>
212 <content><![CDATA[// SPDX-FileCopyrightText: 2020 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
213// SPDX-License-Identifier: AGPL-3.0-or-later
214
215]]></content>
216 </licenseHeader>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100217 </java>
218 </configuration>
219 </plugin>
220
221 <plugin>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100222 <groupId>org.apache.maven.plugins</groupId>
223 <artifactId>maven-enforcer-plugin</artifactId>
224 <version>${enforcer-plugin.version}</version>
225 <executions>
226 <execution>
227 <id>enforce-maven</id>
228 <goals>
229 <goal>enforce</goal>
230 </goals>
231 <configuration>
232 <rules>
233 <requireMavenVersion>
234 <version>${enforced.maven-version}</version>
235 </requireMavenVersion>
236 </rules>
237 </configuration>
238 </execution>
239 </executions>
240 </plugin>
241
242 <plugin>
243 <groupId>org.codehaus.mojo</groupId>
244 <artifactId>exec-maven-plugin</artifactId>
245 <version>${exec-plugin.version}</version>
246 <configuration>
247 <mainClass>eu.mulk.aendggner.AendGgner</mainClass>
248 </configuration>
249 </plugin>
250
251 <plugin>
252 <groupId>org.apache.maven.plugins</groupId>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100253 <artifactId>maven-dependency-plugin</artifactId>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +0200254 <version>${dependency-plugin.version}</version>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100255 <executions>
256 <execution>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100257 <id>copy-dependencies</id>
258 <phase>prepare-package</phase>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100259 <goals>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100260 <goal>copy-dependencies</goal>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100261 </goals>
262 <configuration>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100263 <outputDirectory>
264 ${project.build.directory}/libs
265 </outputDirectory>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +0200266 <includeScope>runtime</includeScope>
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100267 </configuration>
268 </execution>
269 </executions>
270 </plugin>
271
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100272 <plugin>
273 <groupId>org.apache.maven.plugins</groupId>
274 <artifactId>maven-jar-plugin</artifactId>
Matthias Andreas Benkard1b9bfb12026-07-13 07:08:31 +0200275 <version>${jar-plugin.version}</version>
Matthias Andreas Benkardc7f11362020-11-22 15:01:07 +0100276 <configuration>
277 <archive>
278 <manifest>
279 <addClasspath>true</addClasspath>
280 <classpathPrefix>libs/</classpathPrefix>
281 <mainClass>
282 eu.mulk.aendggner.AendGgner
283 </mainClass>
284 </manifest>
285 </archive>
286 </configuration>
287 </plugin>
288
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100289 </plugins>
290
291 </build>
292
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200293 <profiles>
294
295 <!--
296 Browserfassung: übersetzt dieselbe Pipeline mit GraalVM Web Image nach WebAssembly.
297 Ausdrücklich anzufordern (`-Pwasm`); der Standard-Build bleibt unberührt und braucht
298 kein GraalVM.
299
300 Voraussetzung: Oracle GraalVM 25.1+ (Web Image ist dort enthalten, in der CE nicht):
301
302 JAVA_HOME=/pfad/zu/oracle-graalvm ./mvnw -Pwasm package
303
304 Ergebnis: target/web/ — aendggner.js, aendggner.js.wasm und die statischen Seiten.
305 -->
306 <profile>
307 <id>wasm</id>
308
309 <properties>
310 <native-image.executable>${java.home}/bin/native-image</native-image.executable>
311 <wasm.output.directory>${project.build.directory}/web</wasm.output.directory>
312 <!--
313 Die Option „release 21“ beschränkte den Modulpfad auf die dokumentierte JDK-API; die
314 Web-Image-API des GraalVM wäre damit unsichtbar. Deshalb hier source/target statt
315 release — übersetzt wird ohnehin nur mit dem GraalVM, gegen dessen eigene Klassen.
316 -->
317 <maven.compiler.release/>
318 <maven.compiler.source>21</maven.compiler.source>
319 <maven.compiler.target>21</maven.compiler.target>
320 </properties>
321
322 <dependencies>
323 <!--
324 Reines Java-zlib. Web Image bindet die nativen zlib-Funktionen des JDK nicht an
325 (GR-65205); ohne Inflate ist kein PDF lesbar. Siehe
326 src/wasm/java/.../InflaterErsatz.java.
327 -->
328 <dependency>
329 <groupId>org.jruby</groupId>
330 <artifactId>jzlib</artifactId>
331 <version>${jzlib.version}</version>
332 </dependency>
333 </dependencies>
334
335 <build>
336 <plugins>
337
338 <!-- Der Wasm-Quellbaum kommt nur in diesem Profil hinzu: Er braucht die
339 Web-Image-API und svm.jar, die es nur im GraalVM gibt. -->
340 <plugin>
341 <groupId>org.codehaus.mojo</groupId>
342 <artifactId>build-helper-maven-plugin</artifactId>
343 <version>${build-helper-plugin.version}</version>
344 <executions>
345 <execution>
346 <id>wasm-quellen</id>
347 <phase>generate-sources</phase>
348 <goals>
349 <goal>add-source</goal>
350 </goals>
351 <configuration>
352 <sources>
353 <source>src/wasm/java</source>
354 </sources>
355 </configuration>
356 </execution>
357 </executions>
358 </plugin>
359
360 <plugin>
361 <artifactId>maven-compiler-plugin</artifactId>
362 <configuration>
363 <compilerArgs>
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200364 <arg>--add-modules</arg>
365 <arg>org.graalvm.webimage.api</arg>
366 </compilerArgs>
Matthias Andreas Benkardf3b47af2026-08-22 21:23:06 +0200367 <!--
368 Ohne Picocli-Annotationsprozessor: Er meldet die Befehlszeilenklasse
369 eu.mulk.aendggner.AendGgner mit „allDeclaredMethods“ zur Reflexion an, und
370 die Erreichbarkeitsanalyse zieht daraufhin die gesamte Befehlszeilenfassung
371 samt Picocli und den Dateizugriffen ins Browser-Image, obwohl BrowserMain
372 nichts davon anfasst. Im Browser gibt es keine Befehlszeile.
373 -->
374 <proc>none</proc>
375 <annotationProcessorPaths/>
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200376 </configuration>
377 </plugin>
378
Matthias Andreas Benkardf3b47af2026-08-22 21:23:06 +0200379 <!--
380 Ein vorangegangener gewöhnlicher Bau hat die Picocli-Konfiguration womöglich
381 schon nach target/classes gelegt; native-image liest sie von dort auch dann,
382 wenn dieser Bau sie nicht mehr erzeugt. Also fort damit, sonst hinge die
383 Bildgröße davon ab, was vorher lief.
384 -->
385 <plugin>
386 <artifactId>maven-clean-plugin</artifactId>
387 <version>${clean-plugin.version}</version>
388 <executions>
389 <execution>
390 <id>picocli-konfiguration-fort</id>
391 <phase>prepare-package</phase>
392 <goals>
393 <goal>clean</goal>
394 </goals>
395 <configuration>
396 <excludeDefaultDirectories>true</excludeDefaultDirectories>
397 <filesets>
398 <fileset>
399 <directory>
400 ${project.build.outputDirectory}/META-INF/native-image/picocli-generated
401 </directory>
402 </fileset>
403 </filesets>
404 </configuration>
405 </execution>
406 </executions>
407 </plugin>
408
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200409 <plugin>
410 <artifactId>maven-resources-plugin</artifactId>
411 <executions>
412 <execution>
413 <id>statische-seiten</id>
414 <phase>package</phase>
415 <goals>
416 <goal>copy-resources</goal>
417 </goals>
418 <configuration>
419 <outputDirectory>${wasm.output.directory}</outputDirectory>
420 <resources>
421 <resource>
422 <directory>src/main/resources/eu/mulk/aendggner/web</directory>
423 </resource>
424 </resources>
425 </configuration>
426 </execution>
427 </executions>
428 </plugin>
429
430 <plugin>
431 <groupId>org.codehaus.mojo</groupId>
432 <artifactId>exec-maven-plugin</artifactId>
433 <executions>
434 <execution>
435 <id>web-image</id>
436 <phase>package</phase>
437 <goals>
438 <goal>exec</goal>
439 </goals>
440 <configuration>
441 <executable>${native-image.executable}</executable>
442 <arguments>
443 <argument>--tool:svm-wasm</argument>
Matthias Andreas Benkardf3b47af2026-08-22 21:23:06 +0200444 <!-- Größe vor Durchsatz: Das Modul muss über die Leitung, und die
445 Rechenzeit einer Synopse liegt ohnehin im Sekundenbereich. -->
446 <argument>-Os</argument>
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200447 <!-- Der Textzwischenschritt (aendggner.js.wat) wird sonst mehrere hundert
448 Megabyte groß; auf die Größe des .wasm hat das keinen Einfluss. -->
449 <argument>-H:WasmComments=NONE</argument>
450 <argument>-classpath</argument>
451 <classpath/>
452 <argument>-o</argument>
453 <argument>${wasm.output.directory}/aendggner</argument>
454 <argument>eu.mulk.aendggner.wasm.BrowserMain</argument>
455 </arguments>
456 </configuration>
457 </execution>
Matthias Andreas Benkard2d33bf72026-08-16 06:40:07 +0200458
459 <!--
460 Macht aus dem Übersetzerergebnis ein auslieferbares Verzeichnis: entfernt den
461 .wat-Zwischenschritt, legt den Quelltext der gebauten Fassung bei (AGPLv3 §13)
462 und komprimiert vor. Läuft in derselben Phase, aber nach „web-image“ — Maven
463 führt gleichphasige Ausführungen in Deklarationsreihenfolge aus.
464 -->
465 <execution>
466 <id>webpaket</id>
467 <phase>package</phase>
468 <goals>
469 <goal>exec</goal>
470 </goals>
471 <configuration>
472 <executable>${project.basedir}/deploy/webpaket.sh</executable>
473 <arguments>
474 <argument>${wasm.output.directory}</argument>
475 </arguments>
476 </configuration>
477 </execution>
Matthias Andreas Benkard2b1841e2026-08-15 10:51:11 +0200478 </executions>
479 </plugin>
480
481 </plugins>
482 </build>
483 </profile>
484
485 </profiles>
486
Matthias Andreas Benkardb291c362020-11-22 10:22:27 +0100487</project>