I recently started a JavaFX project, and I'd like to use Maven as my compiler/deployment tool.
Is there a good tutorial or plugin to integrate JavaFX and Maven?
Run HelloWorld using MavenIf you want to develop JavaFX applications using Maven, you don't have to download the JavaFX SDK. Just specify the modules and the versions you want in the pom. xml , and the build system will download the required modules, including the native libraries for your platform.
Starting with Java 7u9 I think JavaFX is shipped together with Java SE runtime and the rest, so it makes it pretty easy to create a Maven-based JavaFX project.
Here is what you do (assuming you have latest Java SE 7 runtime environment):
Go to directory where your JRE libs are installed: cd "/c/Program
Files/Java/jre7/lib"
Find what is the version of the JavaFX by reading the javafx.properties file. cat javafx.properties
will produce something like: javafx.runtime.version=2.2.3
Now you are ready to install the JavaFX runtime package to Maven: mvn install:install-file -Dfile=jfxrt.jar -DgroupId=com.oracle -DartifactId=javafx -Dpackaging=jar -Dversion=2.2.3
Finally, create a simple Maven project, in say NetBeans, open your pom.xml file and add the following dependency:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>javafx</artifactId>
<version>2.2.3</version>
</dependency>
Once you save the pom.xml you can continue using your typical Maven workflow.
Please note I used the MSYS (http://www.mingw.org) environment on Windows in the examples above in the case you get confused. If you prefer Windows CMD it would be very much similar. I just do not feel comfortable without BASH and GNU tools such as sed, grep, etc...
This helped me a lot:
Blog Entry
In the beginning of the Blog Entry the author mentions another great Article that can be found here...:
Another Blog
The main "magic" is getting "settings.xml" right... Afterwards...it is not that difficult.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With