opcua-service/pom.xml
2026-05-11 19:40:18 +02:00

323 lines
16 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
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.opcua</groupId>
<artifactId>opcua-gui</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javafx.version>21</javafx.version>
<milo.version>0.6.16</milo.version>
</properties>
<dependencies>
<!-- JavaFX -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<!-- OPC UA / Eclipse Milo 0.6.x (0.x API: readValue, writeValue, thenApply on connect/disconnect) -->
<dependency>
<groupId>org.eclipse.milo</groupId>
<artifactId>sdk-client</artifactId>
<version>${milo.version}</version>
</dependency>
<!-- Jackson for JSON -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<!-- JavaScript editor in JavaFX dialogs -->
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>0.11.2</version>
</dependency>
<!-- GraalVM JS -->
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>23.0.1</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>23.0.1</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<!-- Step 1: Copy the platform-specific JavaFX JARs into target/javafx-jars/
so they can be embedded whole (not unpacked) into the fat JAR.
We copy all three classifiers so the same JAR works on Linux,
Windows and macOS - the Launcher extracts only those it finds. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>copy-javafx-jars</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/javafx-jars</outputDirectory>
<stripVersion>false</stripVersion>
<artifactItems>
<!-- Linux -->
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version><classifier>linux</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version><classifier>linux</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-base</artifactId>
<version>${javafx.version}</version><classifier>linux</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version><classifier>linux</classifier><type>jar</type>
</artifactItem>
<!-- Windows -->
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version><classifier>win</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version><classifier>win</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-base</artifactId>
<version>${javafx.version}</version><classifier>win</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version><classifier>win</classifier><type>jar</type>
</artifactItem>
<!-- macOS -->
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version><classifier>mac</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version><classifier>mac</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-base</artifactId>
<version>${javafx.version}</version><classifier>mac</classifier><type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.openjfx</groupId><artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version><classifier>mac</classifier><type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Step 2: Include the staged JavaFX JARs as META-INF/javafx/*.jar
inside the fat JAR. The Shade plugin then picks them up
as opaque resources (not unpacked), because they are in
src/main/resources-equivalent path at package time. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-javafx-into-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/javafx</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/javafx-jars</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<!-- JavaFX Maven Plugin (nur fuer mvn javafx:run in der Entwicklung) -->
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>de.opcua.app.MainApp</mainClass>
</configuration>
</plugin>
<!-- maven-jar-plugin: Main-Class im nicht-shaded JAR setzen -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>de.opcua.app.Launcher</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!-- Maven Shade Plugin for Fat JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<transformers>
<!-- Main Manifest -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.opcua.app.Launcher</mainClass>
</transformer>
<!-- Service Files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<!-- NOTICE/LICENSE-Dateien zusammenführen -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/versions/*/module-info.class</exclude>
</excludes>
</filter>
<!--
JavaFX .class-Dateien NICHT in die Shade-Klassen entpacken.
Die JavaFX-JARs liegen als ganze Dateien unter
META-INF/javafx/*.jar im Fat-JAR und werden vom Launcher
zur Laufzeit als Modul-Pfad extrahiert.
-->
<filter>
<artifact>org.openjfx:*</artifact>
<excludes>
<exclude>**/*.class</exclude>
<exclude>META-INF/native-image/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>windows-exe</id>
<build>
<plugins>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>build-windows-exe</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>${project.build.directory}/opcua-gui.exe</outfile>
<jar>${project.build.directory}/${project.build.finalName}.jar</jar>
<dontWrapJar>false</dontWrapJar>
<icon>src/main/resources/styles/opcua-client.ico</icon>
<errTitle>OPC UA Client</errTitle>
<classPath>
<mainClass>de.opcua.app.Launcher</mainClass>
</classPath>
<jre>
<minVersion>17</minVersion>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>OPC UA Client</fileDescription>
<copyright>OPC UA Client</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<productName>OPC UA Client</productName>
<internalName>opcua-gui</internalName>
<originalFilename>opcua-gui.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>