The JavaFX packaging tools support web-based distribution via Applets and/or Webstart (JNLP). There are a number of very strong reasons not to use this deployment option (see below), however, since native installation bundles are still quite feature limited and App Store support is non-existent, I've included support for web based distros for those who really want to use them.
To build a web distribution bundle:
mvn clean jfx:web
The resulting web distribution bundle will be built to 'target/jfx/web'. This will include both a JNLP and Applet distribution option for your application.
This is built using the JavaFX packaging tools and there are not a lot of ways to customise this from outside of the tools. The resulting bundle is rather ugly and you will likely want to create your own HTML files to launch your application. Use the generated files as a template for doing this.
Numerous configuration options exist for the web deployment goal, see the javafx:web goal documentation for a full list.
If your app does anything remotely interesting it will most likely need to be signed and have 'allPermissions' set in the POM to allow it to break out of the constraints of the Browser's Sandbox.
To allow this, you need to have the following configuration in your POM at a minimum:
<plugin> <groupId>com.zenjava</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>8.1.2</version> <configuration> <mainClass>your.main.class</mainClass> <keyStoreAlias>your-username</keyStoreAlias> <keyStorePassword>your-password</keyStorePassword> <allPermissions>true</allPermissions> </configuration> </plugin>
Before you can sign your app, you need to have a Keystore to sign it with. If you are deploying into the real world and don't want your users to see a 'this app is not trusted' message, you need a proper certificate from a certifying entity. See this for more information.
If you just want a certificate for testing with (or for deploying on a local network to users who won't get freaked out by the 'not trusted' warning), the JavaFX Maven Plugin includes a handy command for generating a testing Keystore:
mvn jfx:generate-key-store -DcertDomain=com.yourdomain -DcertState=NSW -DcertCountry=AU
It doesn't really matter what you use for your domain, state and country but it's best to try and use something that represents you somewhat. You only need to run this once, then you can save the Keystore into your source control repository and all developers on the team can share it.
On the surface, web deployment looks like a great option, but it has a lot of drawbacks when you actually start using it.
If you have used JNLP or Applets before, it's worth noting that some of these problems are recent additions. The auto-updating issues are worse now due to the security problems and a new policy of always trying to force the user to the latest version to avoid security holes. The buggy aspects of Applets and JNLP seem to be worse at the moment with the mixture of 32bit and 64bit operating systems, browsers and JREs all being combined to bad effect.
Additionally, the web deployment options rely on the use of browser plugins to work. Browser vendors have made strong noises recently about dropping support for plugins. Once this happens, the choice will be out of our hands and all web deployment options will be null and void anyway. It's not clear when browser vendors are going to make this shift, but with the rise of the App Stores, Mac gaining some market traction and Windows 8 very slowly trickling in, the trend is growing.
As well as the problems listed above, web deployment is also the root of all the 'security' problems that have been plaguing Java in recent years and giving it such a bad reputation. If we didn't have web deployed applications we wouldn't have all these security violations that keep busting out of the sandbox and allowing people to do bad things. A lot of good development time is being wasted trying to patch these holes when really we should all just accept that the web deployment dream died back when Netscape Navigator lost the browser war to IE. Flash conceded defeat long ago and it was much better positioned than Java ever was in web deployment. Lets lay the dead to rest.
It would be best if Oracle could deprecate these deployment options and instead focus on adding features to native installers and supporting App Store deployment but too many big players seem intent on clinging to these flawed web deployment models for Oracle to be willing to let them go. I'd encourage anyone doing JFX development to start using the native installation options, and to start putting pressure on the JFX team to invest in developing this and App Store deployment options instead of throwing away good time on web deployment.