Image kreieren mit Maven bei JavaFX und nicht modularen Jars

Tintenfisch

Bekanntes Mitglied
Hallo Forum,
Ich habe ein JavaFx Project, welches ich mit Maven zu einem ausführbaren Programm bilden möchte. Dies Funktioniert in der Regel mittlerweile auch, jedoch kamen nun Libaries mit nicht modularen Jars hinzu.
Ich habe hier im Forum schon Lösungsansätze gefunden, wie beispielsweise mit "Moditect" und habe versucht sie zu rekonstruieren. Allerdings zeigen sich beim bilden weiter die selben Fehlermeldungen: "Error: automatic module cannot be used with jlink: org.apache.commons.io from ...".

Anbei der dazugehörige Code, mit der bitte um Unterstützung.
Meine primäre Quelle hier aus dem Forum: Java Programm veröffentlichen am Besten modular

XML:
<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</groupId>
  <artifactId>orderview</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>oderview</name>
  <description>des</description>
 
   <properties>
           <appName>OrderView</appName>
           <launcherName>orderview</launcherName>
           <moduleName>application</moduleName>
           <mainClass>application.Main</mainClass>
 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
        <maven.compiler.source>15</maven.compiler.source>
        <maven.compiler.target>15</maven.compiler.target>
  </properties>
 
  <!-- DEPENDENCIES -->
  <dependencies>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <version>15</version>
    </dependency>
   
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
      <version>15</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.36.0.3</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.json/json-->
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20220320</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>5.2.2</version>
    </dependency>
   
    <dependency>
       <groupId>org.apache.poi</groupId>
       <artifactId>poi-ooxml</artifactId>
       <version>5.2.2</version>
    </dependency>

  </dependencies>
 
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
     
    <plugins>
    <!-- COMPILE -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>15</release>
        </configuration>
      </plugin>

    <!-- IMAGE -->
       <plugin>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>0.0.5</version>
        <configuration>
          <release>11</release>
          <jlinkImageName>OrderView</jlinkImageName>
          <launcher>orderview</launcher>
          <mainClass>orderview/application.Main</mainClass>
        </configuration>
      </plugin>
     
    </plugins>
  </build>
 
   <!-- NON-MODULARS / MODITECT -->
   <profiles>
           <profile>
               <id>app</id>
               <build>
                   <plugins>
                       <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-dependency-plugin</artifactId>
                           <version>3.1.2</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>1.0.0.RC1</version>
                         
                           <executions>
                            <execution>
                                   <id>add-doule-info-to-dependencies</id>
                                   <phase>package</phase>
                                   <configuration>
                                       <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                       <overwriteExistingFiles>true</overwriteExistingFiles>
                                       <modules>
                                     
                                           <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
                                        <module>
                                            <artifact>
                                                    <groupId>org.apache.commons</groupId>
                                                 <artifactId>commons-collections4</artifactId>
                                                 <version>4.4</version>                              
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons-collections4</name>
                                            </moduleInfo>
                                        </module>
                       
                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
                                           <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-math3</artifactId>
                                                <version>3.6.1</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons-math3</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
                                                <groupId>commons-io</groupId>
                                                <artifactId>commons-io</artifactId>
                                                <version>2.6</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons-io</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-compress</artifactId>
                                                <version>1.3</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons-compress</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
                                                <groupId>commons-codec</groupId>
                                                <artifactId>commons-codec</artifactId>
                                                <version>1.15</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons-codec</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/com.zaxxer/SparseBitSet -->
                                                <groupId>com.zaxxer</groupId>
                                                <artifactId>SparseBitSet</artifactId>
                                                <version>1.2</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>SparseBitSet</name>
                                            </moduleInfo>
                                        </module>
                                       </modules>
                                     
                                       <module>
                                           <mainClass>${mainClass}</mainClass>
                                           <moduleInfo>${project.build.sourceDirectory}/module-info.java</moduleInfo>
                                       </module>
                                   </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>${moduleName}</module>
                                       </modules>
                                       <launcher>
                                           <name>${launcherName}</name>
                                           <module>${moduleName}</module>
                                       </launcher>
                                       <compression>2</compression>
                                       <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>0.1.2</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>${moduleName/}/${mainClass}</module>
                                   </configuration>
                               </execution>
                           </executions>
                       </plugin>                    
                   </plugins>
               </build>
           </profile>
   </profiles>
</project>

Java:
module orderview {
    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
   
    requires java.sql;
    requires org.json;
   
    requires org.apache.poi.poi;
    requires org.apache.poi.ooxml;
   
    requires org.apache.commons.collections4; // nur als Versuch, wird nicht direkt benötigt
   
    exports application;
    opens application;
    exports database;
    exports download;
    exports inEx;
    exports user;
}
 
Du gibst in Moditect ja einen Modulnamen. Dieser kann kein - enthalten. (Kannst Du ja bei dem Namen deines Moduls Testen - IntelliJ meckert den sofort an, sobald Du da ein - einfügst!)

Also beim moditect Plugin aus
Code:
                                            <moduleInfo>
                                                <name>commons-compress</name>
                                            </moduleInfo>

z.B.
Code:
                                            <moduleInfo>
                                                <name>commons.compress</name>
                                            </moduleInfo>
machen.

Und in der module-info.java gibst du mit requires modulnamen an - das wäre dann ein requires commons.compress;

Probier mal diese Änderungen aus und schau, ob es dann funktioniert. Und wenn Du da auch noch weitere Abhängigkeiten an Modulen hast: Evtl. mal schauen, ob die korrekt übernommen werden. Das kann Probleme geben. Wenn da Abhängigkeiten nur von JLink nicht mitgenommen werden, dann reicht ggf. ein requires auf alle so generierten Module.

Sollte dies nicht reichen, dann musst Du in der module-info, die Du da generierst, auch noch requires aufnehmen. Das geht, aber das muss ich mir dann selbst ansehen. (Statt die module-info automatisch generieren zu lassen kannst Du es einmal als Datei generieren und dann angepasst direkt bei moditect mir angeben.)
 
<moduleInfo>
<name>commons.compress</name>
</moduleInfo>
Die Modulnamen sind nun dementsprechend alle angepasst.

Und in der module-info.java gibst du mit requires modulnamen an - das wäre dann ein requires commons.compress;
Bei den Modulnamen in der module-info.java, wird jedoch in vielen Fällen der Fahler gezeigt: "Can't be resolved to a module", sollte ich nur den Modulnamen angeben.
 
Bei den Modulnamen in der module-info.java, wird jedoch in vielen Fällen der Fahler gezeigt: "Can't be resolved to a module", sollte ich nur den Modulnamen angeben.
Ok, da hatte ich noch einen wichtigen Punkt unterschlagen: Der Modul-Name sollte mit dem "Automatic Module Name" überein stimmen.

Der "Automatic Module Name" wird vom jar File abgeleitet - ohne das .jar am Ende. Dabei werden alle Zeichen, die nicht so erlaubt sind, durch einen "." ersetzt.

Also aus der commons-compress.jar wird der Modul-Name: "commons.compress".

Siehe dazu z.B. https://www.geeksforgeeks.org/automatic-modules-in-java/
 
Dazu muss ich vielleicht noch sagen, dass die Module, welche hier ohne Module sind, im Code so nicht benötigt werden. Diese sind lediglich Abhängigkeiten der "Poi" Library.
 
Der Modul-Name sollte mit dem "Automatic Module Name" überein stimmen.
Die Namen hatte ich soweit alle der jar entsprechend übernommen. Fehlerfrei ist dabei allerdings nur die Angabe wie bspw. "requires org.apache.commons.compress;".

Bei "commons.math" wird zwar kein Fehler gezeigt, jedoch darauf hingewiesen, dass der Name instabil sei.
 
So, ich habe mittlerweile wieder eine ganze Menge herumprobiert, doch so wirklich zeigt sich keinerlei Veränderung.
Zuerst wurden einige Schreib- und auch Formfehler in der pom.xml korrigiert, weshalb ich diese nochmal mit zeige.
Ansonsten besteht weiterhin das Problem, dass einige von den Modul-Namen in der "kurzen Schreibweise" (Bsp: "commons.codec"), nicht zugeordnet werden können.
Zugeordnet werden kann bspw. "commons.math3", welches zwar als instabil genannt wird, aber sonst keinen Fehler zeigt.
Wird jedoch Maven mit "javafx:jlink" gestartet, zeigt auch "common.math3" wie vorab den Fehler "... automatic module cannot be used with jlink: ...".

Vielleicht hat ja noch jemand eine Idee, was hier falsch läuft, denn meine Suche geht diesbezüglich bisher ins Leere.

XML:
<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</groupId>
  <artifactId>orderview</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>oderview</name>
  <description>des</description>
 
   <properties>
           <appName>OrderView</appName>
           <launcherName>orderview</launcherName>
           <moduleName>application</moduleName>
           <mainClass>application.Main</mainClass>
 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
        <maven.compiler.source>15</maven.compiler.source>
        <maven.compiler.target>15</maven.compiler.target>
  </properties>
 
  <!-- DEPENDENCIES -->
  <dependencies>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <version>15</version>
    </dependency>
   
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
      <version>15</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.36.0.3</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.json/json-->
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20220320</version>
    </dependency>
   
    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>5.2.2</version>
    </dependency>
   
    <dependency>
       <groupId>org.apache.poi</groupId>
       <artifactId>poi-ooxml</artifactId>
       <version>5.2.2</version>
    </dependency>

  </dependencies>
 
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
     
    <plugins>
    <!-- COMPILE -->
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>15</release>
        </configuration>
      </plugin>

    <!-- IMAGE -->
       <plugin>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>0.0.5</version>
        <configuration>
          <release>11</release>
          <jlinkImageName>OrderView</jlinkImageName>
          <launcher>orderview</launcher>
          <mainClass>orderview/application.Main</mainClass>
        </configuration>
      </plugin>
     
    </plugins>
   
  </build>
 
   <!-- NON-MODULARS / MODITECT -->
 
   <profiles>
           <profile>
               <id>app</id>
               <build>
                   <plugins>
                       <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-dependency-plugin</artifactId>
                           <version>3.1.2</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>1.0.0.RC1</version>
                         
                           <executions>
                 
                            <execution>
                                   <id>add-module-info-to-dependencies</id>
                                   <phase>package</phase>
                                   <configuration>
                                       <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                       <overwriteExistingFiles>true</overwriteExistingFiles>
                                       <modules>
                                     
                                           <module>
                                            <artifact>
                                                   <groupId>org.json</groupId>
                                                <artifactId>json</artifactId>
                                                <version>20220320</version>                          
                                            </artifact>
                                            <moduleInfo>
                                                <name>json</name>
                                            </moduleInfo>
                                        </module>
                                     
                                           <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
                                        <module>
                                            <artifact>
                                                    <groupId>org.apache.commons</groupId>
                                                 <artifactId>commons-collections4</artifactId>
                                                 <version>4.4</version>                              
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.collections4</name>
                                            </moduleInfo>
                                        </module>
                       
                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
                                           <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-math3</artifactId>
                                                <version>3.6.1</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.math3</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
                                                <groupId>commons-io</groupId>
                                                <artifactId>commons-io</artifactId>
                                                <version>2.11.0</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.io</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-compress</artifactId>
                                                <version>1.21</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.compress</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
                                                <groupId>commons-codec</groupId>
                                                <artifactId>commons-codec</artifactId>
                                                <version>1.15</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.codec</name>
                                            </moduleInfo>
                                        </module>
                                       
                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/com.zaxxer/SparseBitSet -->
                                                <groupId>com.zaxxer</groupId>
                                                <artifactId>SparseBitSet</artifactId>
                                                <version>1.2</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>SparseBitSet</name>
                                            </moduleInfo>
                                        </module>
                                       
                                       </modules>
                                     
                                       <module>
                                           <mainClass>${mainClass}</mainClass>
                                           <moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
                                       </module>
                                   </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>${moduleName}</module>
                                       </modules>
                                       <launcher>
                                           <name>${launcherName}</name>
                                           <module>${moduleName}</module>
                                       </launcher>
                                       <compression>2</compression>
                                       <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>0.1.2</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>${moduleName}/${mainClass}</module>
                                   </configuration>
                               </execution>
                           </executions>
                       </plugin>
                                             
                   </plugins>
               </build>
           </profile>
   </profiles>

</project>

Java:
module orderview {
    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
   
    requires java.sql;
   
    requires org.json;
   
    requires org.apache.poi.poi;
    requires org.apache.poi.ooxml;
   
    requires SparseBitSet;
    requires commons.math3;
   
    requires commons.collections4;     // can not be resolved to a module
    requires commons.io;            // can not be resolved to a module
    requires commons.compress;        // can not be resolved to a module
    requires commons.codec;            // can not be resolved to a module
   
    exports application;
    opens application;
    exports database;
    exports download;
    exports inEx;
    exports user;
}
 
Ok, ich habe da im Augenblick keine wirkliche Erklärung parat und müsste das selbst erst tiefer nachlesen.

Ich habe jetzt deine POM genommen um da mal etwas mit zu spielen. Die Modul-Namen, die IntelliJ bei der modul-info.java vorsieht, nimmt man dann einfach in den Moditect Einstellungen.

Und Du hattest in der POM den falschen modulname drin - dein module-name ist orderview.

Und Du hast eine Abhängigkeit, die multi-release, daher muss da auch noch die entsprechende Option bei moditect mit angeben.

Die angepasste POM:
XML:
<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</groupId>
    <artifactId>orderview</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>oderview</name>
    <description>des</description>

    <properties>
        <appName>OrderView</appName>
        <launcherName>orderview</launcherName>
        <moduleName>orderview</moduleName>
        <mainClass>application.Main</mainClass>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>15</maven.compiler.source>
        <maven.compiler.target>15</maven.compiler.target>
    </properties>

    <!-- DEPENDENCIES -->
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>15</version>
        </dependency>

        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>15</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.36.0.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.json/json-->
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20220320</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>5.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.2.2</version>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <!-- COMPILE -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>15</release>
                </configuration>
            </plugin>

            <!-- IMAGE -->
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.5</version>
                <configuration>
                    <release>11</release>
                    <jlinkImageName>OrderView</jlinkImageName>
                    <launcher>orderview</launcher>
                    <mainClass>orderview/application.Main</mainClass>
                </configuration>
            </plugin>

        </plugins>

    </build>

    <!-- NON-MODULARS / MODITECT -->

    <profiles>
        <profile>
            <id>app</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.1.2</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>1.0.0.RC1</version>

                        <executions>

                            <execution>
                                <id>add-module-info-to-dependencies</id>
                                <phase>package</phase>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                    <overwriteExistingFiles>true</overwriteExistingFiles>
                                    <modules>

                                        <module>
                                            <artifact>
                                                <groupId>org.json</groupId>
                                                <artifactId>json</artifactId>
                                                <version>20220320</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.json</name>
                                            </moduleInfo>
                                        </module>

                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
                                        <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-collections4</artifactId>
                                                <version>4.4</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.collections4</name>
                                            </moduleInfo>
                                        </module>

                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
                                        <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-math3</artifactId>
                                                <version>3.6.1</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.math3</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
                                                <groupId>commons-io</groupId>
                                                <artifactId>commons-io</artifactId>
                                                <version>2.11.0</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.io</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-compress</artifactId>
                                                <version>1.21</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.compress</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
                                                <groupId>commons-codec</groupId>
                                                <artifactId>commons-codec</artifactId>
                                                <version>1.15</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.codec</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/com.zaxxer/SparseBitSet -->
                                                <groupId>com.zaxxer</groupId>
                                                <artifactId>SparseBitSet</artifactId>
                                                <version>1.2</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>SparseBitSet</name>
                                            </moduleInfo>
                                        </module>

                                    </modules>

                                    <module>
                                        <mainClass>${mainClass}</mainClass>
                                        <moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
                                    </module>

                                    <jdepsExtraArgs>
                                        <arg>--multi-release</arg>
                                        <arg>17</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>${moduleName}</module>
                                    </modules>
                                    <launcher>
                                        <name>${launcherName}</name>
                                        <module>${moduleName}</module>
                                    </launcher>
                                    <compression>2</compression>
                                    <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>0.1.2</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>${moduleName}/${mainClass}</module>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

</project>

Die module-info.java (einige exports von dir habe ich rausgenommen):
Java:
module orderview {
    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
  
    requires java.sql;
  
    requires org.json;
  
    requires org.apache.poi.poi;
    requires org.apache.poi.ooxml;
  
    requires SparseBitSet;
    requires commons.math3;
  
    requires org.apache.commons.collections4;
    requires org.apache.commons.io;
    requires org.apache.commons.compress;
    requires org.apache.commons.codec;
  
    exports application;
    opens application;
}
 
Ok, ich habe da im Augenblick keine wirkliche Erklärung parat und müsste das selbst erst tiefer nachlesen.

Ich habe jetzt deine POM genommen um da mal etwas mit zu spielen. Die Modul-Namen, die IntelliJ bei der modul-info.java vorsieht, nimmt man dann einfach in den Moditect Einstellungen.

Und Du hattest in der POM den falschen modulname drin - dein module-name ist orderview.

Und Du hast eine Abhängigkeit, die multi-release, daher muss da auch noch die entsprechende Option bei moditect mit angeben.

Die angepasste POM:
XML:
<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</groupId>
    <artifactId>orderview</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>oderview</name>
    <description>des</description>

    <properties>
        <appName>OrderView</appName>
        <launcherName>orderview</launcherName>
        <moduleName>orderview</moduleName>
        <mainClass>application.Main</mainClass>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>15</maven.compiler.source>
        <maven.compiler.target>15</maven.compiler.target>
    </properties>

    <!-- DEPENDENCIES -->
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>15</version>
        </dependency>

        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>15</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.36.0.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.json/json-->
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20220320</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>5.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.2.2</version>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <!-- COMPILE -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>15</release>
                </configuration>
            </plugin>

            <!-- IMAGE -->
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.5</version>
                <configuration>
                    <release>11</release>
                    <jlinkImageName>OrderView</jlinkImageName>
                    <launcher>orderview</launcher>
                    <mainClass>orderview/application.Main</mainClass>
                </configuration>
            </plugin>

        </plugins>

    </build>

    <!-- NON-MODULARS / MODITECT -->

    <profiles>
        <profile>
            <id>app</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.1.2</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>1.0.0.RC1</version>

                        <executions>

                            <execution>
                                <id>add-module-info-to-dependencies</id>
                                <phase>package</phase>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/modules</outputDirectory>
                                    <overwriteExistingFiles>true</overwriteExistingFiles>
                                    <modules>

                                        <module>
                                            <artifact>
                                                <groupId>org.json</groupId>
                                                <artifactId>json</artifactId>
                                                <version>20220320</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.json</name>
                                            </moduleInfo>
                                        </module>

                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
                                        <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-collections4</artifactId>
                                                <version>4.4</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.collections4</name>
                                            </moduleInfo>
                                        </module>

                                        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
                                        <module>
                                            <artifact>
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-math3</artifactId>
                                                <version>3.6.1</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>commons.math3</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
                                                <groupId>commons-io</groupId>
                                                <artifactId>commons-io</artifactId>
                                                <version>2.11.0</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.io</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
                                                <groupId>org.apache.commons</groupId>
                                                <artifactId>commons-compress</artifactId>
                                                <version>1.21</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.compress</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
                                                <groupId>commons-codec</groupId>
                                                <artifactId>commons-codec</artifactId>
                                                <version>1.15</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>org.apache.commons.codec</name>
                                            </moduleInfo>
                                        </module>

                                        <module>
                                            <artifact>
                                                <!-- https://mvnrepository.com/artifact/com.zaxxer/SparseBitSet -->
                                                <groupId>com.zaxxer</groupId>
                                                <artifactId>SparseBitSet</artifactId>
                                                <version>1.2</version>
                                            </artifact>
                                            <moduleInfo>
                                                <name>SparseBitSet</name>
                                            </moduleInfo>
                                        </module>

                                    </modules>

                                    <module>
                                        <mainClass>${mainClass}</mainClass>
                                        <moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
                                    </module>

                                    <jdepsExtraArgs>
                                        <arg>--multi-release</arg>
                                        <arg>17</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>${moduleName}</module>
                                    </modules>
                                    <launcher>
                                        <name>${launcherName}</name>
                                        <module>${moduleName}</module>
                                    </launcher>
                                    <compression>2</compression>
                                    <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>0.1.2</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>${moduleName}/${mainClass}</module>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

</project>

Die module-info.java (einige exports von dir habe ich rausgenommen):
Java:
module orderview {
    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
 
    requires java.sql;
 
    requires org.json;
 
    requires org.apache.poi.poi;
    requires org.apache.poi.ooxml;
 
    requires SparseBitSet;
    requires commons.math3;
 
    requires org.apache.commons.collections4;
    requires org.apache.commons.io;
    requires org.apache.commons.compress;
    requires org.apache.commons.codec;
 
    exports application;
    opens application;
}
Erst einmal vielen Dank für die Mühe. Ich habe das ganze nun soweit übernommen und letztlich kopiert um nichts zu übersehen. Die Modul-Namen werden nun erkannt, jedoch zeigten sich beim bilden mit Maven immer noch die selben Fehler.

Merkwürdig finde ich auch, dass auch org.json nicht mit jlink genutzt werden kann, bzw. der Fehler dort kommt, da in einem anderen Project, dies ohne weitere Beachtung, nur als dependency eingebunden, funktioniert hat.

(Statt die module-info automatisch generieren zu lassen kannst Du es einmal als Datei generieren und dann angepasst direkt bei moditect mir angeben.)
meine module-info.java mit dem Modul "orderview", hatte ich nicht automatisch generieren lassen, sondern als File erzeugt.
 
Zuletzt bearbeitet:
Am besten das ganze Log vom mvn clean package -P app angeben.
Habe Maven nun mal mit mvn clean package -P app laufen lassen und weitere Fehler wie Formatierung behoben. Auch wurde bezüglich der jdbc.jar auf das Automatikmodul hingewiesen, was vorher nicht ersichtlich war. Dieses Teil läuft jetzt soweit Fehlerfrei.

Teste ich mvn javafx:jlink -e, kommen jedoch Fehler bezüglich jlink und den Automatik-Modulen.
Anbei der Log.

C#:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< com:orderview >----------------------------
[INFO] Building oderview 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> javafx-maven-plugin:0.0.5:jlink (default-cli) > process-classes @ orderview >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ orderview ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ orderview ---
[WARNING] *********************************************************************************************************************************************************************
[WARNING] * Required filename-based automodules detected: [commons-math3-3.6.1.jar, SparseBitSet-1.2.jar]. Please don't publish this project to a public artifact repository! *
[WARNING] *********************************************************************************************************************************************************************
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< javafx-maven-plugin:0.0.5:jlink (default-cli) < process-classes @ orderview <<<
[INFO]
[INFO]
[INFO] --- javafx-maven-plugin:0.0.5:jlink (default-cli) @ orderview ---
[WARNING] Required filename-based automodules detected. Please don't publish this project to a public artifact repository!
Error: automatic module cannot be used with jlink: org.apache.commons.collections4 from file:///C:/Users/Tintenfisch/.m2/repository/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:553)
    at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:420)
    at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:209)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
        at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:553)
        at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:420)
        at org.openjfx.JavaFXJLinkMojo.execute(JavaFXJLinkMojo.java:209)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.147 s
[INFO] Finished at: 2022-09-10T07:56:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.5:jlink (default-cli) on project orderview: Error: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.5:jlink (default-cli) on project orderview: Error
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
    at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:241)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
    at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:235)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:553)
    at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:420)
    at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:209)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 
Zuletzt bearbeitet:
Das javafx Plugin kann raus. Du baust kein Image mit diesem Plugin!

Das moditect Plugin baut auch das Image!

Du hast da zwei Teile:
a) add-module-info-to-dependencies -> Das baut dir entsprechende Module mit Beschreibung.
b) create-runtime-image -> Das baut das Runtime Image!

Also alles, was Du brauchst ist dieses
mvnw clean package -P app
damit dann auch die Images gebaut werden.

Dank dem JPackage Plugin wird auch direkt das App-Image gebaut!

Schau nach dem Aufruf einfach mal nach:
./target/jlink-image/
./target/jpackage (oder so - keine Ahnung, was da der default name ist.)

Also noch einmal ganz deutlich: KEIN javafx:jlink oder so. Der ganze Block:
Java:
            <!-- IMAGE -->
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.5</version>
                <configuration>
                    <release>11</release>
                    <jlinkImageName>OrderView</jlinkImageName>
                    <launcher>orderview</launcher>
                    <mainClass>orderview/application.Main</mainClass>
                </configuration>
            </plugin>
kann raus!

Und evtl. willst Du das, was im Profil "app" ist, richtig eingliedern.
 

Zurück
Oben