Observations from using Maven to manage a JavaFX project in NetBeans 6.8:
- Place all JavaFX source files in src\main\javafx. Otherwise, NetBeans complains about not being able to find com.sun.javafx.runtime.FXBase.
- Place all Java source files in src\main\java, just like a normal Java project.
- Ignore the error message in JavaFX files about being in a non-JavaFX project. If the standard project definition lets you mix Java and JavaFX source files, why not in a Maven project?
- Fix Imports will not fix imports for your own classes. You must manually type in the import statement, and resist the urge to use the command later as it will remove your own imported classes.
- Even if you do manage to keep your imports, you still have to contend with complaints about variable types.




And yet, this project will still compile, despite the warnings.
Advertisement
[...] When I got to the point of implementing a horizontal split, I thought I would use an enum to represent the divider orientation, instead of using static integers. Unfortunately, you have to use a Java enum, as there is no such beast in JavaFX. This is where I ran into issues with Maven, as described in an earlier post. [...]