As you are developing JavaFX-applications, you might want to look at the javapackager
, which is included with the Oracle JDK. But instead of using that javapackager
directly, you might want to check out the javafx-maven-plugin, which contains a built-in support for having your own files being assigned to your application when being installed:
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>com.zenjava.test.Main</mainClass>
<verbose>true</verbose>
<fileAssociations>
<fileAssociation>
<description>association 1</description>
<extensions>ext1</extensions>
<contentType>application/dummy</contentType>
<icon>somePathToIcon</icon>
</fileAssociation>
<fileAssociation>
<description>association 2</description>
<extensions>ext2</extensions>
<contentType>application/dummy2</contentType>
</fileAssociation>
</fileAssociations>
</configuration>
</plugin>
In order to have this working, just call mvn clean jfx:native
and installers are created where that file-association is created for you.
You can find the example for single filetype-associations here: https://github.com/javafx-maven-plugin/javafx-maven-plugin/tree/master/src/it/22-create-fileassociations-single-mimetypes
For multiple file-extensions, you can find the example here: https://github.com/javafx-maven-plugin/javafx-maven-plugin/tree/master/src/it/21-create-fileassociations
Please keep in mind, that the file-fileassociations only is done while installing your application and will be removed on removal of your application, which means that developing you want to install it once and might want to replace that bundle.
Disclaimer: I'm the maintainer of the javafx-maven-plugin