JavaFX NetBean Konfiguration

hk

Bekanntes Mitglied
Ich habe NetBean 24, jdk-23 und javafx-sdk-19. Wenn ich ein Maven Project "FXML JavaFX Maven Archtype" erstelle und eine JAR Variante des Projects erstellen will sieht das Protokoll wie nachstehend aus. Ich glaube dass mit dem Zusammenspiel der Komponenten etwas nicht stimmt.
Vielleicht kann mir wer weiterhelfen?

cd D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven; "JAVA_HOME=C:\\Program Files\\Java\\jdk-23" cmd /c "\"C:\\Program Files\\NetBeans-24\\netbeans\\java\\maven\\bin\\mvn.cmd\" \"-Dmaven.ext.class.path=C:\\Program Files\\NetBeans-24\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" --no-transfer-progress -Prelease-profile install"
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.my:TestMaven:jar:1.0-Test
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ org.apache.maven:maven-model-builder:3.9.9:super-pom, jar:file:/C:/Program%20Files/NetBeans-24/netbeans/java/maven/lib/maven-model-builder-3.9.9.jar!/org/apache/maven/model/pom-4.0.0.xml, line 110, column 19
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ org.apache.maven:maven-model-builder:3.9.9:super-pom, jar:file:/C:/Program%20Files/NetBeans-24/netbeans/java/maven/lib/maven-model-builder-3.9.9.jar!/org/apache/maven/model/pom-4.0.0.xml, line 122, column 19
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ org.apache.maven:maven-model-builder:3.9.9:super-pom, jar:file:/C:/Program%20Files/NetBeans-24/netbeans/java/maven/lib/maven-model-builder-3.9.9.jar!/org/apache/maven/model/pom-4.0.0.xml, line 134, column 19
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] --------------------------< com.my:TestMaven >--------------------------
[INFO] Building TestMaven 1.0-Test
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] Ignoring incompatible plugin version 4.0.0-beta-1: The plugin org.apache.maven.plugins:maven-source-plugin:4.0.0-beta-1 requires Maven version 4.0.0-beta-3
[INFO] Latest version of plugin org.apache.maven.plugins:maven-source-plugin failed compatibility check
[INFO] Looking for compatible RELEASE version of plugin org.apache.maven.plugins:maven-source-plugin
[INFO] Selected plugin org.apache.maven.plugins:maven-source-plugin:3.3.1
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ TestMaven ---
[INFO] Copying 2 resources from src\main\resources to target\classes
[INFO]
[INFO] --- compiler:3.8.0:compile (default-compile) @ TestMaven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ TestMaven ---
[INFO] skip non existing resourceDirectory D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\test\resources
[INFO]
[INFO] --- compiler:3.8.0:testCompile (default-testCompile) @ TestMaven ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:3.2.5:test (default-test) @ TestMaven ---
[INFO] No tests to run.
[INFO]
[INFO] --- jar:3.4.1:jar (default-jar) @ TestMaven ---
[INFO] Building jar: D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test.jar
[INFO]
[INFO] --- source:3.3.1:jar-no-fork (attach-sources) @ TestMaven ---
[INFO] Building jar: D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test-sources.jar
[INFO]
[INFO] --- javadoc:3.11.2:jar (attach-javadocs) @ TestMaven ---
[INFO] No previous run data found, generating javadoc.
[WARNING] Javadoc Warnings
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\App.java:14: warning: use of default constructor, which does not provide a comment
[WARNING] public class App extends Application {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\App.java:34: warning: no comment
[WARNING] public static void main(String[] args) {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\PrimaryController.java:6: warning: no comment
[WARNING] public class PrimaryController {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\PrimaryController.java:6: warning: use of default constructor, which does not provide a comment
[WARNING] public class PrimaryController {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\SecondaryController.java:6: warning: no comment
[WARNING] public class SecondaryController {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\com\my\testmaven\SecondaryController.java:6: warning: use of default constructor, which does not provide a comment
[WARNING] public class SecondaryController {
[WARNING] ^
[WARNING] D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\src\main\java\module-info.java:1: warning: no comment
[WARNING] module com.my.testmaven {
[WARNING] ^
[WARNING] 7 warnings
[INFO] Building jar: D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test-javadoc.jar
[INFO]
[INFO] --- install:3.1.2:install (default-install) @ TestMaven ---
[INFO] Installing D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\pom.xml to C:\Users\User\.m2\repository\com\my\TestMaven\1.0-Test\TestMaven-1.0-Test.pom
[INFO] Installing D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test.jar to C:\Users\User\.m2\repository\com\my\TestMaven\1.0-Test\TestMaven-1.0-Test.jar
[INFO] Installing D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test-sources.jar to C:\Users\User\.m2\repository\com\my\TestMaven\1.0-Test\TestMaven-1.0-Test-sources.jar
[INFO] Installing D:\Heinz\EigeneProgrammeSource\NetBeansProjects\TestMaven\target\TestMaven-1.0-Test-javadoc.jar to C:\Users\User\.m2\repository\com\my\TestMaven\1.0-Test\TestMaven-1.0-Test-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.128 s
[INFO] Finished at: 2024-12-26T13:52:25+01:00
[INFO] ------------------------------------------------------------------------
 

KonradN

Super-Moderator
Mitarbeiter
Also prinzipiell sind das nur Warnungen und das sollte keine wirklichen Auswirkungen haben.

Bei paar Plugins ist keine Version angegeben worden. Das sollte man dann im POM File noch zusätzlich eintragen. Das führt halt ansonsten dazu, dass z.B. beim source Plugin eine Version geladen wird, die nicht kompatibel ist.

Dann sind da ein paar Warnungen von javadoc: Du hast halt nicht überall JavaDoc Kommentare, wo es erwartet wird. Das betrifft aber nur die Dokumentation und nicht die Software selbst.

Der Build ist ansonsten soweit erfolgreich. Die Probleme, die Du hast, sind da also nicht direkt von abhängig.
 

KonradN

Super-Moderator
Mitarbeiter
Wenn es um das starten der erzeugten jar Datei geht: Dein Ansatz ist etwas dubios. Wenn Du Maven nutzt, dann brauchst Du kein JavaFX SDK zu installieren oder so. Zeig ggf. mal deine pom Datei um die Details des Projektes zu sehen.

Evtl willst Du Dir aber auch einfach einmal https://github.com/kneitzel/JavaFXMavenApp ansehen. Das zeigt recht gut, wie man einiges einbinden kann. Du kannst das Projekt als Template für Dein JavaFX Projekt nutzen oder Du kopierst einfach Teile aus der pom, die Du brauchst (um z.B. ein Image zu bauen, das Du dann weitergeben kannst. Oder den Part für das FAT Jar, das dann auch alle Abhängigkeiten enthält).
 

hk

Bekanntes Mitglied
Wenn es um das starten der erzeugten jar Datei geht: Dein Ansatz ist etwas dubios. Wenn Du Maven nutzt, dann brauchst Du kein JavaFX SDK zu installieren oder so. Zeig ggf. mal deine pom Datei um die Details des Projektes zu sehen.

Evtl willst Du Dir aber auch einfach einmal https://github.com/kneitzel/JavaFXMavenApp ansehen. Das zeigt recht gut, wie man einiges einbinden kann. Du kannst das Projekt als Template für Dein JavaFX Projekt nutzen oder Du kopierst einfach Teile aus der pom, die Du brauchst (um z.B. ein Image zu bauen, das Du dann weitergeben kannst. Oder den Part für das FAT Jar, das dann auch alle Abhängigkeiten enthält).
Meine Pom sieht so aus:
Java:
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.my</groupId>
    <artifactId>TestMaven</artifactId>
    <version>1.0-Test</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>13</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>13</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!--<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin> -->
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <mainClass>com.my.testmaven.App</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <!-- Default configuration for running -->
                        <!-- Usage: mvn clean javafx:run -->
                        <id>default-cli</id>
                    </execution>
                    <execution>
                        <!-- Configuration for manual attach debugging -->
                        <!-- Usage: mvn clean javafx:run@debug -->
                        <id>debug</id>
                        <configuration>
                            <options>
                                <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000</option>
                            </options>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Configuration for automatic IDE debugging -->
                        <id>ide-debug</id>
                        <configuration>
                            <options>
                                <option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
                            </options>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Configuration for automatic IDE profiling -->
                        <id>ide-profile</id>
                        <configuration>
                            <options>
                <option>${profiler.jvmargs.arg1}</option>
                <option>${profiler.jvmargs.arg2}</option>
                <option>${profiler.jvmargs.arg3}</option>
                <option>${profiler.jvmargs.arg4}</option>
                <option>${profiler.jvmargs.arg5}</option>
                            </options>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
 
Ähnliche Java Themen

Ähnliche Java Themen

Neue Themen


Oben