I was not able to build an executable file from a maven/gluonfx project, but i partially solved opening x64 Native tools, using cd command to move into the gluonfx project folder and i used the
mvn gluonfx:build command to build the app. So everything works but, no fxml is loaded, just like this:
but if i use mvn gluonfx:run command into intellij,everything works, like this:
So if i try to use mvn gluonfx:nativerun command into x64 Native tools program, it gives me this error:
So probably there is a problem loading the FXML. If i try to run the app, using the mvn gluonfx:run command into the x64 Native tools program it still works. So i think that the problem is related with native run, and it has a problem loading the fxml in this configuration.
This is my pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.knnapplication</groupId>
<artifactId>knn-application</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>KNN-Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>19</javafx.version>
<attach.version>4.0.16</attach.version>
<gluonfx.plugin.version>1.0.15</gluonfx.plugin.version>
<javafx.plugin.version>0.0.8</javafx.plugin.version>
<mainClassName>com.knnapplication.KNNApplication</mainClassName>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
<artifactId>charm-glisten</artifactId>
<version>6.1.1</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>statusbar</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>util</artifactId>
<version>${attach.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Gluon</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>${gluonfx.plugin.version}</version>
<configuration>
<target>${gluonfx.target}</target>
<attachList>
<list>display</list>
<list>lifecycle</list>
<list>statusbar</list>
<list>storage</list>
</attachList>
<reflectionList>
<list>com.knnapplication.views.PrimaryPresenter</list>
<list>com.knnapplication.views.SecondaryPresenter</list>
</reflectionList>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ios</id>
<properties>
<gluonfx.target>ios</gluonfx.target>
</properties>
</profile>
<profile>
<id>android</id>
<properties>
<gluonfx.target>android</gluonfx.target>
</properties>
</profile>
</profiles>
</project>
EXCEPTION:
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] nov 13, 2022 8:38:42 PM com.sun.javafx.application.PlatformImpl startup
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6e8dacdf'
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] nov 13, 2022 8:38:42 PM com.gluonhq.attach.util.Platform <clinit>
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] INFO: [Gluon Attach] System Property javafx.platform is not defined. Platform will be set to Platform.DESKTOP
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] IOException: javafx.fxml.LoadException:
[dom nov 13 20:38:42 CET 2022][INFO] [SUB] /com/knnapplication/views/primary.fxml:37
[dom nov 13 20:38:42 CET 2022][INFO] [SUB]
LINE 37 of PRIMARY FXML