Files
2026-11-19 10:21:28 +01:00

306 lines
12 KiB
XML

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.molnarandrei</groupId>
<artifactId>sopa</artifactId>
<version>1.0.4</version>
<name>sopa</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>21</maven.compiler.release>
<junit.version>5.12.1</junit.version>
<!-- Distribution (see <build>). Liberica "Full" JDKs ship JavaFX jmods per platform. -->
<dist.name>${project.artifactId}-${project.version}</dist.name>
<dist.dir>${project.build.directory}/dist/${dist.name}</dist.dir>
<dist.jdks>${project.basedir}/.jdks</dist.jdks>
<dist.jdk.version>21.0.13.0.3+5</dist.jdk.version>
<dist.jdk.dir>jdk-21.0.13.0.3-full</dist.jdk.dir>
<dist.jdk.url>https://github.com/bell-sw/Liberica/releases/download/${dist.jdk.version}/bellsoft-jdk${dist.jdk.version}</dist.jdk.url>
<!-- Modules for the bundled runtime. Beyond what jdeps reports: java.desktop/javafx.fxml
(module-info), jdk.crypto.ec (HTTPS), jdk.localedata (non-English locales),
jdk.unsupported (used reflectively by JavaFX and libraries). -->
<dist.modules>java.base,java.desktop,java.logging,java.management,java.naming,java.net.http,java.sql,java.xml,jdk.charsets,jdk.crypto.ec,jdk.httpserver,jdk.localedata,jdk.unsupported,javafx.base,javafx.controls,javafx.fxml,javafx.graphics</dist.modules>
</properties>
<dependencyManagement>
<dependencies>
<!-- Align jackson-annotations with Jackson 3.x. Without this, wiremock's
transitive jackson-annotations 2.20 wins "nearest wins" mediation and
Jackson 3 databind fails at runtime (missing JsonSerializeAs). -->
<dependency>
<groupId>tools.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>3.2.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- javafx -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>21.0.6</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>21.0.6</version>
</dependency>
<!-- javafx theming & apprearence sugar -->
<dependency>
<groupId>io.github.mkpaz</groupId>
<artifactId>atlantafx-base</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>12.4.0</version>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-materialdesign2-pack</artifactId>
<version>12.4.0</version>
</dependency>
<dependency>
<!-- Google's official Material Icons (filled/outlined/round/sharp). -->
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-material2-pack</artifactId>
<version>12.4.0</version>
</dependency>
<!-- text area with highlighting used for input and output xml -->
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>0.11.7</version>
</dependency>
<!-- .yml testcase reading -->
<dependency>
<groupId>tools.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.22.0</version>
</dependency>
<!-- soap -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>5.4.1</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Plugin for junit that creates a SOAP api, or other apis. -->
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.14.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<!--
`mvn package` produces:
target/${dist.name}-shaded.jar fat jar (needs a JDK 21; JavaFX natives for the build OS only)
target/${dist.name}.zip self-contained distribution, unzipped copy in target/dist/:
sopa.sh / sopa.bat launchers (from src/dist; sopa.bat uses javaw)
jars/ app + dependencies, shared by both platforms
runtime/linux/, runtime/windows/ jlinked JREs with JavaFX, x86_64
org.openjfx jars are left out of jars/: JavaFX comes from the runtimes, and the Maven
jars only carry natives for the build machine. The app runs on the classpath (via
Launcher), so non-modular dependencies are fine. The JDKs (~700 MB) download once into
.jdks/, outside target/, so `mvn clean` keeps them. Plugins below bound to `package`
run in the order declared.
-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<!-- mvn javafx:run -->
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>com.molnarandrei.sopa/com.molnarandrei.sopa.ui.SopaApplication</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<!-- Merge META-INF/services, otherwise only one Ikonli pack registers and icons vanish. -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.molnarandrei.sopa.Launcher</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<excludeGroupIds>org.openjfx</excludeGroupIds>
<outputDirectory>${dist.dir}/jars</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jreleaser</groupId>
<artifactId>jdks-maven-plugin</artifactId>
<version>1.27.0</version>
<dependencies>
<!-- Its plexus-utils 4.x lacks Xpp3DomUtils (moved to plexus-xml); unpacking fails without it. -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>setup-jdks</goal>
</goals>
<configuration>
<outputDirectory>${dist.jdks}</outputDirectory>
<jdks>
<jdk>
<name>linux</name>
<platform>linux-x86_64</platform>
<url>${dist.jdk.url}-linux-amd64-full.tar.gz</url>
<checksum>SHA-1/451cc597bd5ddbb597fe4dab08d64e88eedeb52b</checksum>
</jdk>
<jdk>
<name>windows</name>
<platform>windows-x86_64</platform>
<url>${dist.jdk.url}-windows-amd64-full.zip</url>
<checksum>SHA-1/17047626c28b30aa4042e555f370703969a627ce</checksum>
</jdk>
</jdks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="jlink" value="${dist.jdks}/linux/${dist.jdk.dir}/bin/jlink"/>
<property name="jlink.args" value="--add-modules ${dist.modules} --no-header-files --no-man-pages --strip-debug --compress=zip-6"/>
<!-- Linux-only executables; Ant's copy and zip both drop the executable bit. -->
<property name="executables" value="sopa.sh,runtime/linux/bin/*,runtime/linux/lib/jspawnhelper,runtime/linux/lib/jexec"/>
<!-- jlink refuses an existing output dir. -->
<delete dir="${dist.dir}/runtime"/>
<!-- The linux jlink builds both runtimes; the target platform comes from the jmods. -->
<exec executable="${jlink}" failonerror="true">
<arg line="${jlink.args} --module-path ${dist.jdks}/linux/${dist.jdk.dir}/jmods --output ${dist.dir}/runtime/linux"/>
</exec>
<exec executable="${jlink}" failonerror="true">
<arg line="${jlink.args} --module-path ${dist.jdks}/windows/${dist.jdk.dir}/jmods --output ${dist.dir}/runtime/windows"/>
</exec>
<copy file="${project.build.directory}/${project.build.finalName}.jar" todir="${dist.dir}/jars"/>
<copy todir="${dist.dir}">
<fileset dir="${project.basedir}/src/dist"/>
</copy>
<fixcrlf file="${dist.dir}/sopa.sh" eol="lf"/>
<fixcrlf file="${dist.dir}/sopa.bat" eol="crlf"/>
<chmod perm="755">
<fileset dir="${dist.dir}" includes="${executables}"/>
</chmod>
<zip destfile="${project.build.directory}/${dist.name}.zip">
<zipfileset dir="${dist.dir}" prefix="${dist.name}" filemode="755" includes="${executables}"/>
<zipfileset dir="${dist.dir}" prefix="${dist.name}" excludes="${executables}"/>
</zip>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>