Template
Test to have a direct jpackage call inside the project.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<main.module>FXAppModule</main.module>
|
||||
<java.version>17</java.version>
|
||||
<required.maven.version>3.6.3</required.maven.version>
|
||||
<jar.file>javafxapp</jar.file>
|
||||
|
||||
<!-- Dependency versions -->
|
||||
<junit.version>5.9.1</junit.version>
|
||||
@@ -52,6 +53,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven.compiler.release>${java.version}</maven.compiler.release>
|
||||
|
||||
</properties>
|
||||
|
||||
@@ -66,6 +68,11 @@
|
||||
<artifactId>javafx-graphics</artifactId>
|
||||
<version>${javafx.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-fxml</artifactId>
|
||||
<version>${javafx.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-web</artifactId>
|
||||
@@ -108,6 +115,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${jar.file}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -191,208 +199,6 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${maven.dependency.plugin}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.moditect</groupId>
|
||||
<artifactId>moditect-maven-plugin</artifactId>
|
||||
<version>${moditect.maven.plugin}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-module-info-to-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<jvmVersion>${java.version}</jvmVersion>
|
||||
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
||||
<overwriteExistingFiles>true</overwriteExistingFiles>
|
||||
<modules>
|
||||
<!--
|
||||
<module>
|
||||
<artifact>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
</artifact>
|
||||
<moduleInfo>
|
||||
<name>org.apache.logging.log4j.core</name>
|
||||
</moduleInfo>
|
||||
</module>
|
||||
-->
|
||||
|
||||
<module>
|
||||
<artifact>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</artifact>
|
||||
<moduleInfoSource>
|
||||
open module org.apache.logging.log4j.core {
|
||||
requires java.logging;
|
||||
requires java.rmi;
|
||||
|
||||
requires transitive java.compiler;
|
||||
requires transitive java.desktop;
|
||||
requires transitive java.management;
|
||||
requires transitive java.naming;
|
||||
requires transitive java.scripting;
|
||||
requires transitive java.sql;
|
||||
requires transitive java.xml;
|
||||
|
||||
requires org.apache.logging.log4j;
|
||||
|
||||
exports org.apache.logging.log4j.core;
|
||||
exports org.apache.logging.log4j.core.appender;
|
||||
exports org.apache.logging.log4j.core.appender.db;
|
||||
exports org.apache.logging.log4j.core.appender.db.jdbc;
|
||||
exports org.apache.logging.log4j.core.appender.mom;
|
||||
exports org.apache.logging.log4j.core.appender.mom.jeromq;
|
||||
exports org.apache.logging.log4j.core.appender.mom.kafka;
|
||||
exports org.apache.logging.log4j.core.appender.nosql;
|
||||
exports org.apache.logging.log4j.core.appender.rewrite;
|
||||
exports org.apache.logging.log4j.core.appender.rolling;
|
||||
exports org.apache.logging.log4j.core.appender.rolling.action;
|
||||
exports org.apache.logging.log4j.core.appender.routing;
|
||||
exports org.apache.logging.log4j.core.async;
|
||||
exports org.apache.logging.log4j.core.config;
|
||||
exports org.apache.logging.log4j.core.config.arbiters;
|
||||
exports org.apache.logging.log4j.core.config.builder.api;
|
||||
exports org.apache.logging.log4j.core.config.builder.impl;
|
||||
exports org.apache.logging.log4j.core.config.composite;
|
||||
exports org.apache.logging.log4j.core.config.json;
|
||||
exports org.apache.logging.log4j.core.config.plugins;
|
||||
exports org.apache.logging.log4j.core.config.plugins.convert;
|
||||
exports org.apache.logging.log4j.core.config.plugins.processor;
|
||||
exports org.apache.logging.log4j.core.config.plugins.util;
|
||||
exports org.apache.logging.log4j.core.config.plugins.validation;
|
||||
exports org.apache.logging.log4j.core.config.plugins.validation.constraints;
|
||||
exports org.apache.logging.log4j.core.config.plugins.validation.validators;
|
||||
exports org.apache.logging.log4j.core.config.plugins.visitors;
|
||||
exports org.apache.logging.log4j.core.config.properties;
|
||||
exports org.apache.logging.log4j.core.config.status;
|
||||
exports org.apache.logging.log4j.core.config.xml;
|
||||
exports org.apache.logging.log4j.core.config.yaml;
|
||||
exports org.apache.logging.log4j.core.filter;
|
||||
exports org.apache.logging.log4j.core.filter.mutable;
|
||||
exports org.apache.logging.log4j.core.impl;
|
||||
exports org.apache.logging.log4j.core.jackson;
|
||||
exports org.apache.logging.log4j.core.jmx;
|
||||
exports org.apache.logging.log4j.core.layout;
|
||||
exports org.apache.logging.log4j.core.layout.internal;
|
||||
exports org.apache.logging.log4j.core.lookup;
|
||||
exports org.apache.logging.log4j.core.message;
|
||||
exports org.apache.logging.log4j.core.net;
|
||||
exports org.apache.logging.log4j.core.net.ssl;
|
||||
exports org.apache.logging.log4j.core.osgi;
|
||||
exports org.apache.logging.log4j.core.parser;
|
||||
exports org.apache.logging.log4j.core.pattern;
|
||||
exports org.apache.logging.log4j.core.script;
|
||||
exports org.apache.logging.log4j.core.selector;
|
||||
exports org.apache.logging.log4j.core.time;
|
||||
exports org.apache.logging.log4j.core.time.internal;
|
||||
exports org.apache.logging.log4j.core.tools;
|
||||
exports org.apache.logging.log4j.core.tools.picocli;
|
||||
exports org.apache.logging.log4j.core.util;
|
||||
exports org.apache.logging.log4j.core.util.datetime;
|
||||
exports org.apache.logging.log4j.core.util.internal;
|
||||
|
||||
uses org.apache.logging.log4j.core.util.WatchEventService;
|
||||
uses org.apache.logging.log4j.core.util.ContextDataProvider;
|
||||
|
||||
provides javax.annotation.processing.Processor with
|
||||
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor;
|
||||
provides org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory with
|
||||
org.apache.logging.log4j.core.message.ExtendedThreadInfoFactory;
|
||||
provides org.apache.logging.log4j.spi.Provider with
|
||||
org.apache.logging.log4j.core.impl.Log4jProvider;
|
||||
|
||||
provides org.apache.logging.log4j.core.util.ContextDataProvider with
|
||||
org.apache.logging.log4j.core.impl.ThreadContextDataProvider;
|
||||
}
|
||||
</moduleInfoSource>
|
||||
</module>
|
||||
|
||||
</modules>
|
||||
|
||||
<module>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
<moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
|
||||
</module>
|
||||
|
||||
<jdepsExtraArgs>
|
||||
<arg>--ignore-missing-deps</arg>
|
||||
<arg>--multi-release</arg>
|
||||
<arg>${java.version}</arg>
|
||||
</jdepsExtraArgs>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>add-module-info</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>create-runtime-image</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>create-runtime-image</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<modulePath>
|
||||
<path>${project.build.directory}/modules</path>
|
||||
</modulePath>
|
||||
<modules>
|
||||
<module>${main.module}</module>
|
||||
</modules>
|
||||
<launcher>
|
||||
<name>${launcher}</name>
|
||||
<module>${main.module}</module>
|
||||
</launcher>
|
||||
<bindServices>true</bindServices>
|
||||
<compression>2</compression>
|
||||
<!-- <jarInclusionPolicy>NONE</jarInclusionPolicy> -->
|
||||
<jarInclusionPolicy>APP_WITH_DEPENDENCIES</jarInclusionPolicy>
|
||||
<stripDebug>true</stripDebug>
|
||||
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.akman</groupId>
|
||||
<artifactId>jpackage-maven-plugin</artifactId>
|
||||
<version>${jpackage.maven.plugin}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jpackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<name>${appName}</name>
|
||||
<type>IMAGE</type>
|
||||
<runtimeimage>${project.build.directory}/jlink-image</runtimeimage>
|
||||
<module>${main.module}/${main.class}</module>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.spotbugs</groupId>
|
||||
<artifactId>spotbugs-maven-plugin</artifactId>
|
||||
@@ -484,6 +290,92 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${maven.dependency.plugin}</version>
|
||||
<executions>
|
||||
<!-- erstmal Abhängigkeiten für den Class-Path kopieren -->
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
||||
<excludeGroupIds>org.openjfx</excludeGroupIds>
|
||||
<includeScope>runtime</includeScope>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>${project.packaging}</type>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<!-- dazu noch das Projekt-JAR -->
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>${project.packaging}</type>
|
||||
<destFileName>${project.build.finalName}.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.akman</groupId>
|
||||
<artifactId>jpackage-maven-plugin</artifactId>
|
||||
<version>${jpackage.maven.plugin}</version>
|
||||
<configuration>
|
||||
<name>${appName}</name>
|
||||
<type>IMAGE</type>
|
||||
<modulepath>
|
||||
<dependencysets>
|
||||
<dependencyset>
|
||||
<includenames>
|
||||
<includename>javafx\..*</includename>
|
||||
</includenames>
|
||||
</dependencyset>
|
||||
</dependencysets>
|
||||
</modulepath>
|
||||
<addmodules>
|
||||
<addmodule>javafx.controls</addmodule>
|
||||
</addmodules>
|
||||
<mainclass>${main.class}</mainclass>
|
||||
<input>${project.build.directory}/modules</input>
|
||||
<mainjar>${jar.file}.jar</mainjar>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>jpackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user