The article of Sergey suggests to add javafx as a system dependency, which should not be used. Instead, you can include the following in your POM to install javafx automatically.
install-javafx
org.apache.maven.plugins
maven-install-plugin
2.3.1
install-javafx
install-file
validate
${jfx-runtime}/lib/jfxrt.jar
javafx
javafx
${jfx-version}
jar
${jfx-runtime}/../docs/api.zip
maven-resources-plugin
install-javafx-bin
validate
copy-resources
${settings.localRepository}/javafx/javafx
false
${jfx-runtime}
bin/*.dll
If you want to have api docs installed, zip the contents of of the docs/api folder to docs/api.zip. Now you just have to run maven, with the profile activated and the jfx-runtime and jfx-version properties set.