I want to create a executable jar. I read how to make a MANIFEST.MF, but I read with maven is pretty much easier:
but that solution doesn't include the fxml files.
Do you know a plugin for that or some tutorial that explain how and where I should insert the fxml files.
I noted that solution doesn't include gif or other file to jar too. So, I think that the should be a same solution to include other types of files to jar.
I'm near to deadline (yesterday). So any help that permit me make it in 5 min (anyone can dream) will be more than welcome.
Thank in advance.
You can use Zenjava-Javafx-maven-plugin
for this. Just add this to your pom.xml
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>your.package.with.Launcher</mainClass>
</configuration>
</plugin>
Than use mvn jfx:jar
command to create javafx jar
. The jar-file
will be placed at target/jfx/app
.
If you wish to create a javafx native bundle, use this configuration,
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>YourCompany</vendor>
<mainClass>your.package.with.Launcher</mainClass>
</configuration>
</plugin>
and this command: mvn jfx:native
. The native launchers or installers will be placed at target/jfx/native
.