Ich habe WIX 3.14 und wenn ich folgende Anweisung ausführe dann bekomme ich eine exe-Datei - mit Icon - welche beim Start kurz ein Fenster zeigt und dann nichts mehr tut.Das klingt jetzt erst einmal nach einem Installer, den Du haben willst.
Evtl. reicht dazu schon die Möglichkeiten von JPackage aus: https://docs.oracle.com/en/java/javase/24/jpackage/manage-installation.html
Ich selbst nutze JPackage aber nur, um das eigentliche Package zu bauen. Installer sind dann separat und werden von mir direkt gehandhabt. Dazu nutzte ich in der Vergangenheit WiX (Windows Installer XML) http://wixtoolset.org/
--main-jar satan.jar
Die konfigurierte Haupt-JAR-Datei ist im Eingabeverzeichnis nicht vorhanden satan.jar
Im Verzeichnis target steht die satan-1.0.jar.
$WshShell = New-Object -COMObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut(„$Home\Desktop\MyApp.lnk“)
$Shortcut.TargetPath = „%SystemDrive%\Program Files (x86)\MyApp\MyApp.exe“
$Shortcut.Save()
param ( [string]$SourceExe, [string]$DestinationPath )
$WshShell = New-Objekt -COMObjekt WScript.Shell
$Shortcut = $WshShell.CreateShortcut($DestinationPath)
$Shortcut.TargetPath = $SourceExe
$Shortcut.Save()
Set-Shortcut „%SystemDrive%\Program Files (x86)\MyApp\MyApp.exe“ „$Home\Desktop\MyApp.lnk“
$Shortcut.Arguments = „/argument=wert“
param ( [string]$SourceExe, [string]$ArgumentsToSourceExe, [string]$DestinationPath )
$WshShell = New-Object -COMObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($DestinationPath)
$Shortcut.TargetPath = $SourceExe
$Shortcut.Arguments = $ArgumentsToSourceExe
$Shortcut.Save()
@echo aus
setlocal
set scriptPath=%~dp0Set-Shortcut.PS1
# Check if the script is running with admin privileges
openfiles >nul 2>&1
if '%errorlevel%' == '0' (
# If already running with admin privileges, run the PowerShell script
powershell -ExecutionPolicy Bypass -File "%scriptPath%"
) else (
# If not running with admin privileges, relaunch the batch file with elevated privileges echo requesting admin privileges...
powershell -Command "Start-Process cmd -ArgumentList '/c %~s0' -Verb RunAs"
)
ProcessLauncher launcher = new ProcessLauncher();
String scriptPath = "run_as_admin.bat"; // Adjust the path to batch script
ProcessResult result = launcher.runScript(scriptPath);
Ich habe Windows und setze mit der Power-Shell folgende Anweisung ab um meiner Anwendung ein Desktop-Icon zu geben.In Windows könnte man PowerShell verwenden, wenn man keinen Installer hat. In Linux Desktopumgebungen erstellt man im richtigen Ordner einfach eine myapp.desktop - Datei (Textdatei) mit Nutzerrechten.
Ich weis nicht ob ich mich richtig ausgedrückt habe. Ich habe eine Maven-JavaFX-Anwendung mit einer IDE (NetBeans) erstellt und möchte ihr ein Desktop-Icon hinzufügen. Das habe ich mit PowerShell und der jpackage Anweisung versucht wobei die erstellte EXE nicht funktioniert. Ich weis auch nicht ob ich damit am richtigen Weg bin.Also ich baue mit JPackage immer nur ein App-Image, für welches ich dann selbst den Installer (so benötigt) erstelle. Die Möglichkeiten von JPackage sind halt diesbezüglich viel zu eingeschränkt.
Wie man im xml dann bei WIX ein Shortcut erstellen kann, würde dann z.B. hier beschrieben:
Logging einbauen!Daher meine Frage was ich tun kann um das Problem zu erkennen.
System.out.println
Du kannst das Programm in einer Konsole starten, bspw.: cmd. Möglicherweise siehst du dann eine Fehlermeldung.welche beim Start kurz ein Windows-Fenster zeigt und dann nichts mehr
Genau das habe ich gemacht. Mit deiner Pom aus JavaFXMavenApp. Daher habe ich eine lauffähige EXE die funktioniert. Diese hat jedoch das Standard-Icon von Windows am Desktop, und dieses will ich durch ein eigenes Icon ersetzen. Dabei brauche ich Hilfe (was ist ein geeignetes Tool, wie ist die Vorgangsweise).Daher einfach einmal den Ansatz von mir:
- Ich baue Projekte mit Maven. Da gehört dann auch der JPackage Aufruf dazu. Wie so ein Projekt dann aussehen kann, siehst Du in dem Template Projekt JavaFXMavenApp. Wenn man dort den Weg über JPackage geht (Profil image), dann bekommst Du ein Verzeichnis mit der Anwendung. Da ist dann u.a. eine exe dabei sowie viele Dateien/Ordner drumherum, die für die Anwendung notwendig sind.
Auch in PowerShell blitzt nur kurz ein Fenster auf, keine Fehlermeldung.Du kannst das Programm in einer Konsole starten, bspw.: cmd. Möglicherweise siehst du dann eine Fehlermeldung.
Ok, also geht es Dir nicht um ein Shortcut (Icon) auf dem Desktop zum starten der Anwendung sondern einfach nur darum, dass Du das Icon der Anwendung anpassen möchtest von der erzeugten exe?Genau das habe ich gemacht. Mit deiner Pom aus JavaFXMavenApp. Daher habe ich eine lauffähige EXE die funktioniert. Diese hat jedoch das Standard-Icon von Windows am Desktop, und dieses will ich durch ein eigenes Icon ersetzen. Dabei brauche ich Hilfe (was ist ein geeignetes Tool, wie ist die Vorgangsweise).
<icon>config/jpackage/launcher.ico</icon>
Ich finde in der POM einDazu kannst Du einfach in der Configuration des Akman JPackage Plugins das icon setzen mit etwas wie:
<plugin>
<groupId>com.github.akman</groupId>
...
<icon>${project.basedir}/config/jpackage/resources/appname.ico</icon>
Das hat nicht funktioniertJa, das wäre der Bereich. Das addlaunchers ist nur wichtig, wenndu mehrere Starter brauchst. Das Icon kann direkt unter configurationgeschrieben werden für den Standard launcher.
<plugin>
<groupId>com.github.akman</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>${jpackage.maven.plugin}</version>
<configuration>
<icon>${project.basedir}/resources/satan.ico</icon> <!-- von mir für Icon -->
<name>${appName}</name>
<type>IMAGE</type>
<mainclass>${main.class}</mainclass>
<input>${project.build.directory}/modules</input>
<mainjar>${jar.filename}.jar</mainjar>
</configuration>
...
[INFO] --- maven-dependency-plugin:3.7.1:copy (copy) @ satan ---
[INFO] Configured Artifact: aut.heinz:satan:1.0:jar
[INFO] Copying artifact 'aut.heinz:satan:jar:1.0' (D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\satan-1.0.jar) to D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\modules\satan-1.0.jar
[INFO]
[INFO] --- jpackage-maven-plugin:0.1.5:jpackage (default) @ satan ---
[INFO] Version of [jpackage]: 21.0.5
[WARNING] The main module descriptor not found
[ERROR]
Exit code: 1
[ERROR]
Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-21.0.5\bin\jpackage.exe" @D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\jpackage.opts"
[ERROR]
Command options was:
# jpackage
--dest D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\jpackage
--type app-image
--name 'satan'
--icon D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\${project.basedir}\resources\satan.ico
--input D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\modules
--main-jar 'satan-1.0.jar'
--main-class aut.heinz.Main
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.979 s
[INFO] Finished at: 2025-06-10T09:19:26+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.akman:jpackage-maven-plugin:0.1.5:jpackage (default) on project satan: Error: Tool execution failed [jpackage] with exit code: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.akman:jpackage-maven-plugin:0.1.5:jpackage (default) on project satan: Error: Tool execution failed [jpackage] with exit code: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
Habe ich auch schon probiert:Wenn Du Dir die erzeugte Kommandozeile anschaust, dann siehst Du direkt, dass die die Angabe des project.basedir nicht brauchst. Du siehst ja, wie er aus dem angegeben Wert den Parameter für --icon aufbaut.
<plugin>
<groupId>com.github.akman</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>${jpackage.maven.plugin}</version>
<configuration>
<icon>resources/satan.ico</icon> <!-- von mir für Icon -->
<name>${appName}</name>
<type>IMAGE</type>
<mainclass>${main.class}</mainclass>
<input>${project.build.directory}/modules</input>
<mainjar>${jar.filename}.jar</mainjar>
</configuration>
[INFO] --- jpackage-maven-plugin:0.1.5:jpackage (default) @ satan ---
[INFO] Version of [jpackage]: 21.0.5
[WARNING] The main module descriptor not found
[ERROR]
Exit code: 1
[ERROR]
Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-21.0.5\bin\jpackage.exe" @D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\jpackage.opts"
[ERROR]
Command options was:
# jpackage
--dest D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\jpackage
--type app-image
--name 'satan'
--icon D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\resources\satan.ico
--input D:\Heinz\EigeneProgrammeSource\NetBeansProjects\Satanspatience\JavaFXMavenApp-main\target\modules
--main-jar 'satan-1.0.jar'
--main-class aut.heinz.Main
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.460 s
[INFO] Finished at: 2025-06-10T10:40:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.akman:jpackage-maven-plugin:0.1.5:jpackage (default) on project satan: Error: Tool execution failed [jpackage] with exit code: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.akman:jpackage-maven-plugin:0.1.5:jpackage (default) on project satan: Error: Tool execution failed [jpackage] with exit code: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
Nein,Und die Datei gibt es und zwar genau an dem Ort und in der Gross-/Kleinschreibung:
Nein, habe keine module-info.java im Projekt. Wie komme ich dazu? Dann noch die ganze POM:Und da es um Modul-Beschreibungen geht: Hast Du module-info.java Dateien in Deinem Projekt?
<?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>aut.heinz</groupId>
<artifactId>satan</artifactId>
<version>1.0</version>
<organization>
<name>Heinz Koeck</name>
</organization>
<properties>
<!-- Application Properties -->
<link.name>${project.artifactId}</link.name>
<launcher>${project.artifactId}</launcher>
<appName>${project.artifactId}</appName>
<main.class>aut.heinz.Main</main.class>
<java.version>21</java.version>
<required.maven.version>3.8.6</required.maven.version>
<jar.filename>${project.artifactId}-${project.version}</jar.filename>
<!-- Dependency versions -->
<javafx.version>21.0.5</javafx.version>
<jetbrains.annotations.version>24.1.0</jetbrains.annotations.version>
<junit.version>5.10.2</junit.version>
<lombok.version>1.18.34</lombok.version>
<mockito.version>5.12.0</mockito.version>
<!-- Plugin dependencies -->
<codehaus.version.plugin>2.17.1</codehaus.version.plugin>
<javafx.maven.plugin>0.0.8</javafx.maven.plugin>
<jpackage.maven.plugin>0.1.5</jpackage.maven.plugin>
<maven.clean.plugin>3.4.0</maven.clean.plugin>
<maven.compiler.plugin>3.13.0</maven.compiler.plugin>
<maven.dependency.plugin>3.7.1</maven.dependency.plugin>
<maven.deploy.plugin>3.1.2</maven.deploy.plugin>
<maven.enforcer.plugin>3.5.0</maven.enforcer.plugin>
<maven.install.plugin>3.1.2</maven.install.plugin>
<maven.jar.plugin>3.4.2</maven.jar.plugin>
<maven.javadoc.plugin>3.7.0</maven.javadoc.plugin>
<maven.project.info.reports.plugin>3.6.2</maven.project.info.reports.plugin>
<maven.resources.plugin>3.3.1</maven.resources.plugin>
<maven.shade.plugin>3.6.0</maven.shade.plugin>
<maven.site.plugin>4.0.0-M15</maven.site.plugin>
<maven.surfire.plugin>3.3.1</maven.surfire.plugin>
<moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin>
<maven.pmd.plugin>3.24.0</maven.pmd.plugin>
<spotbugs.maven.plugin>4.8.6.2</spotbugs.maven.plugin>
<spotbugs.version>4.8.6</spotbugs.version>
<!-- other properties -->
<pmd.target>pmd</pmd.target> <!-- Set to 'pmd' if pmd should not fail on issues. Set to 'check' if you want build to fail when issues found -->
<spotbugs.target>spotbugs</spotbugs.target> <!-- Set to 'spotbugs' if spotbugs should not fail on issues. Set to 'check' if you want build to fail when issues found -->
<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>
<dependencies>
<!-- JavaFX dependencies -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<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>
<version>${javafx.version}</version>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- JUnit 5 -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<!-- Dependency used for @NotNull / @Nullable -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>${jetbrains.annotations.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<!-- von mir für resourcen verwendung eingefügt -->
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<!-- End meiner Einfügung -->
<finalName>${jar.filename}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven.enforcer.plugin}</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>${required.maven.version}</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin}</version>
<configuration>
<release>${java.version}</release>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven.install.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven.site.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surfire.plugin}</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.maven.plugin}</version>
<dependencies>
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>${spotbugs.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>${spotbugs.target}</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- pmd funktioniert mit jdk 23 nicht -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven.pmd.plugin}</version>
<configuration>
<minimumTokens>100</minimumTokens>
<targetJdk>${java.version}</targetJdk>
<linkXRef>false</linkXRef>
<rulesets>
<ruleset>pmd-ruleset.xml</ruleset>
</rulesets>
</configuration>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>${pmd.target}</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${codehaus.version.plugin}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
<goal>display-property-updates</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- JavaFX Plugin to start application -->
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin}</version>
<configuration>
<mainClass>${main.class}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven.project.info.reports.plugin}</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>dependencies</report>
<report>licenses</report>
<report>summary</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin}</version>
<reportSets>
<reportSet>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
<reportSet>
<id>tests</id>
<configuration>
<show>private</show>
</configuration>
<reports>
<report>test-javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<!-- pmd funktioniert mit jdk 23 nicht -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven.pmd.plugin}</version>
<reportSets>
<reportSet>
<reports>
<report>pmd</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.maven.plugin}</version>
<reportSets>
<reportSet>
<reports>
<report>spotbugs</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<profiles>
<!-- Profile that adds JLink and JPackage runs.
Add -Pimage or -Dimage to use this profile.
-->
<profile>
<id>image</id>
<activation>
<property>
<name>image</name>
</property>
</activation>
<build>
<plugins>
<!-- Copy dependencies -->
<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>
<includeScope>runtime</includeScope>
<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>
<icon>src/main/resources/satan.ico</icon> <!-- von mir für Icon -->
<name>${appName}</name>
<type>IMAGE</type>
<mainclass>${main.class}</mainclass>
<input>${project.build.directory}/modules</input>
<mainjar>${jar.filename}.jar</mainjar>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>jpackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Profile to build a fat jar
Add -Pfatjar or -Dfatjar to use this profile.
-->
<profile>
<id>fatjar</id>
<activation>
<property>
<name>fatjar</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>full</shadedClassifierName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${main.class}</Main-Class>
<Build-Version>1.0</Build-Version>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<name>satan</name>
</project>
Ja, es ist erledigt und funktioniert, herzlichen Dank. Trotzdem würde ich gerne wissen wie das mit der "module-info.java" ist. Wer muss die erstellen, wo gehört sie hin?Ok, wenn es mit dem angepassten Pfad nun funktioniert, dann dürfte das Problem behoben sein und eine weitere Analyse nicht notwendig. Oder habe ich das missverstanden und dein Problem ist noch offen? Danke.