| <?xml version="1.0"?> |
| <project |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" |
| xmlns="http://maven.apache.org/POM/4.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| |
| <modelVersion>4.0.0</modelVersion> |
| |
| <groupId>eu.mulk</groupId> |
| <artifactId>aendggner</artifactId> |
| <version>${revision}</version> |
| |
| <properties> |
| <maven.compiler.parameters>true</maven.compiler.parameters> |
| <maven.compiler.release>21</maven.compiler.release> |
| |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| |
| <enforced.maven-version>3.9.0</enforced.maven-version> |
| |
| <build-helper-plugin.version>3.6.0</build-helper-plugin.version> |
| <compiler-plugin.version>3.15.0</compiler-plugin.version> |
| <dependency-plugin.version>3.11.0</dependency-plugin.version> |
| <enforcer-plugin.version>3.6.3</enforcer-plugin.version> |
| <exec-plugin.version>3.6.3</exec-plugin.version> |
| <jar-plugin.version>3.5.0</jar-plugin.version> |
| <resources-plugin.version>3.5.0</resources-plugin.version> |
| <spotless-plugin.version>3.8.0</spotless-plugin.version> |
| <surefire-plugin.version>3.5.6</surefire-plugin.version> |
| |
| <google.java.format.version>1.28.0</google.java.format.version> |
| |
| <assertj.version>3.27.7</assertj.version> |
| <java-diff-utils.version>4.17</java-diff-utils.version> |
| <jboss-logging.version>3.6.3.Final</jboss-logging.version> |
| <jzlib.version>1.1.5</jzlib.version> |
| <jspecify.version>1.0.0</jspecify.version> |
| <junit.version>5.13.4</junit.version> |
| <pdfbox.version>3.0.8</pdfbox.version> |
| <picocli.version>4.7.7</picocli.version> |
| <slf4j.version>2.0.18</slf4j.version> |
| </properties> |
| |
| <dependencyManagement> |
| <dependencies> |
| <dependency> |
| <groupId>org.junit</groupId> |
| <artifactId>junit-bom</artifactId> |
| <version>${junit.version}</version> |
| <type>pom</type> |
| <scope>import</scope> |
| </dependency> |
| </dependencies> |
| </dependencyManagement> |
| |
| <dependencies> |
| |
| <!-- Annotations --> |
| <dependency> |
| <groupId>org.jspecify</groupId> |
| <artifactId>jspecify</artifactId> |
| <version>${jspecify.version}</version> |
| </dependency> |
| |
| <!-- Command line parsing --> |
| <dependency> |
| <groupId>info.picocli</groupId> |
| <artifactId>picocli</artifactId> |
| <version>${picocli.version}</version> |
| </dependency> |
| |
| <!-- Logging --> |
| <dependency> |
| <groupId>org.jboss.logging</groupId> |
| <artifactId>jboss-logging</artifactId> |
| <version>${jboss-logging.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-jdk14</artifactId> |
| <version>${slf4j.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>jcl-over-slf4j</artifactId> |
| <version>${slf4j.version}</version> |
| </dependency> |
| |
| <!-- PDF text extraction --> |
| <dependency> |
| <groupId>org.apache.pdfbox</groupId> |
| <artifactId>pdfbox</artifactId> |
| <version>${pdfbox.version}</version> |
| </dependency> |
| |
| <!-- Text diffing --> |
| <dependency> |
| <groupId>io.github.java-diff-utils</groupId> |
| <artifactId>java-diff-utils</artifactId> |
| <version>${java-diff-utils.version}</version> |
| </dependency> |
| |
| <!-- Testing --> |
| <dependency> |
| <groupId>org.junit.jupiter</groupId> |
| <artifactId>junit-jupiter</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.assertj</groupId> |
| <artifactId>assertj-core</artifactId> |
| <version>${assertj.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| </dependencies> |
| |
| <build> |
| |
| <resources> |
| <resource> |
| <directory>src/main/resources</directory> |
| </resource> |
| </resources> |
| |
| <pluginManagement> |
| <plugins> |
| |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>versions-maven-plugin</artifactId> |
| <configuration> |
| <generateBackupPoms>false</generateBackupPoms> |
| </configuration> |
| </plugin> |
| |
| </plugins> |
| </pluginManagement> |
| |
| <plugins> |
| |
| <!-- Compiler --> |
| <plugin> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>${compiler-plugin.version}</version> |
| <configuration> |
| <annotationProcessorPaths> |
| <path> |
| <groupId>info.picocli</groupId> |
| <artifactId>picocli-codegen</artifactId> |
| <version>${picocli.version}</version> |
| </path> |
| </annotationProcessorPaths> |
| <compilerArgs> |
| <arg>-Aproject=${project.groupId}/${project.artifactId}</arg> |
| </compilerArgs> |
| </configuration> |
| </plugin> |
| |
| <!-- Resources --> |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>${resources-plugin.version}</version> |
| </plugin> |
| |
| <!-- Tests --> |
| <plugin> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <version>${surefire-plugin.version}</version> |
| </plugin> |
| |
| <!-- Google Java Code Formatter, for enforcing style conventions --> |
| <plugin> |
| <groupId>com.diffplug.spotless</groupId> |
| <artifactId>spotless-maven-plugin</artifactId> |
| <version>${spotless-plugin.version}</version> |
| <configuration> |
| <java> |
| <removeUnusedImports/> |
| <importOrder> |
| <order>java,javax,org,com,de,io,dagger,eu.mulk,</order> |
| </importOrder> |
| <googleJavaFormat> |
| <version>${google.java.format.version}</version> |
| <style>GOOGLE</style> |
| </googleJavaFormat> |
| </java> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-enforcer-plugin</artifactId> |
| <version>${enforcer-plugin.version}</version> |
| <executions> |
| <execution> |
| <id>enforce-maven</id> |
| <goals> |
| <goal>enforce</goal> |
| </goals> |
| <configuration> |
| <rules> |
| <requireMavenVersion> |
| <version>${enforced.maven-version}</version> |
| </requireMavenVersion> |
| </rules> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <version>${exec-plugin.version}</version> |
| <configuration> |
| <mainClass>eu.mulk.aendggner.AendGgner</mainClass> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <version>${dependency-plugin.version}</version> |
| <executions> |
| <execution> |
| <id>copy-dependencies</id> |
| <phase>prepare-package</phase> |
| <goals> |
| <goal>copy-dependencies</goal> |
| </goals> |
| <configuration> |
| <outputDirectory> |
| ${project.build.directory}/libs |
| </outputDirectory> |
| <includeScope>runtime</includeScope> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-jar-plugin</artifactId> |
| <version>${jar-plugin.version}</version> |
| <configuration> |
| <archive> |
| <manifest> |
| <addClasspath>true</addClasspath> |
| <classpathPrefix>libs/</classpathPrefix> |
| <mainClass> |
| eu.mulk.aendggner.AendGgner |
| </mainClass> |
| </manifest> |
| </archive> |
| </configuration> |
| </plugin> |
| |
| </plugins> |
| |
| </build> |
| |
| <profiles> |
| |
| <!-- |
| Browserfassung: übersetzt dieselbe Pipeline mit GraalVM Web Image nach WebAssembly. |
| Ausdrücklich anzufordern (`-Pwasm`); der Standard-Build bleibt unberührt und braucht |
| kein GraalVM. |
| |
| Voraussetzung: Oracle GraalVM 25.1+ (Web Image ist dort enthalten, in der CE nicht): |
| |
| JAVA_HOME=/pfad/zu/oracle-graalvm ./mvnw -Pwasm package |
| |
| Ergebnis: target/web/ — aendggner.js, aendggner.js.wasm und die statischen Seiten. |
| --> |
| <profile> |
| <id>wasm</id> |
| |
| <properties> |
| <native-image.executable>${java.home}/bin/native-image</native-image.executable> |
| <wasm.output.directory>${project.build.directory}/web</wasm.output.directory> |
| <!-- |
| Die Option „release 21“ beschränkte den Modulpfad auf die dokumentierte JDK-API; die |
| Web-Image-API des GraalVM wäre damit unsichtbar. Deshalb hier source/target statt |
| release — übersetzt wird ohnehin nur mit dem GraalVM, gegen dessen eigene Klassen. |
| --> |
| <maven.compiler.release/> |
| <maven.compiler.source>21</maven.compiler.source> |
| <maven.compiler.target>21</maven.compiler.target> |
| </properties> |
| |
| <dependencies> |
| <!-- |
| Reines Java-zlib. Web Image bindet die nativen zlib-Funktionen des JDK nicht an |
| (GR-65205); ohne Inflate ist kein PDF lesbar. Siehe |
| src/wasm/java/.../InflaterErsatz.java. |
| --> |
| <dependency> |
| <groupId>org.jruby</groupId> |
| <artifactId>jzlib</artifactId> |
| <version>${jzlib.version}</version> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <plugins> |
| |
| <!-- Der Wasm-Quellbaum kommt nur in diesem Profil hinzu: Er braucht die |
| Web-Image-API und svm.jar, die es nur im GraalVM gibt. --> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>build-helper-maven-plugin</artifactId> |
| <version>${build-helper-plugin.version}</version> |
| <executions> |
| <execution> |
| <id>wasm-quellen</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>add-source</goal> |
| </goals> |
| <configuration> |
| <sources> |
| <source>src/wasm/java</source> |
| </sources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <plugin> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <configuration> |
| <compilerArgs> |
| <arg>-Aproject=${project.groupId}/${project.artifactId}</arg> |
| <arg>--add-modules</arg> |
| <arg>org.graalvm.webimage.api</arg> |
| </compilerArgs> |
| <annotationProcessorPaths> |
| <path> |
| <groupId>info.picocli</groupId> |
| <artifactId>picocli-codegen</artifactId> |
| <version>${picocli.version}</version> |
| </path> |
| </annotationProcessorPaths> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>statische-seiten</id> |
| <phase>package</phase> |
| <goals> |
| <goal>copy-resources</goal> |
| </goals> |
| <configuration> |
| <outputDirectory>${wasm.output.directory}</outputDirectory> |
| <resources> |
| <resource> |
| <directory>src/main/resources/eu/mulk/aendggner/web</directory> |
| </resource> |
| </resources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>web-image</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>${native-image.executable}</executable> |
| <arguments> |
| <argument>--tool:svm-wasm</argument> |
| <!-- Der Textzwischenschritt (aendggner.js.wat) wird sonst mehrere hundert |
| Megabyte groß; auf die Größe des .wasm hat das keinen Einfluss. --> |
| <argument>-H:WasmComments=NONE</argument> |
| <argument>-classpath</argument> |
| <classpath/> |
| <argument>-o</argument> |
| <argument>${wasm.output.directory}/aendggner</argument> |
| <argument>eu.mulk.aendggner.wasm.BrowserMain</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| |
| <!-- |
| Macht aus dem Übersetzerergebnis ein auslieferbares Verzeichnis: entfernt den |
| .wat-Zwischenschritt, legt den Quelltext der gebauten Fassung bei (AGPLv3 §13) |
| und komprimiert vor. Läuft in derselben Phase, aber nach „web-image“ — Maven |
| führt gleichphasige Ausführungen in Deklarationsreihenfolge aus. |
| --> |
| <execution> |
| <id>webpaket</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>${project.basedir}/deploy/webpaket.sh</executable> |
| <arguments> |
| <argument>${wasm.output.directory}</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| </plugins> |
| </build> |
| </profile> |
| |
| </profiles> |
| |
| </project> |