javafx-maven-plugin
javafx-maven-plugin copied to clipboard
Add required plugins versions to components
Mainly the goal is to include in the JavaFX plugin a "dependency" on the Maven compiler plugin 3.8.1, so users don't need to include this plugin in their pom, only to increase the default version.
As we discussed, this can be done by overriding the phases of the default lifecycle in the components.xml file, if I got it right.
Not sure which problem you're trying to solve, but adding plugins as dependency to other plugins is not the Maven way. Don't try to turn the JavaFX plugin as a God/Monolithic plugin. In the end people should be able to adjust the configuration of all the used plugins, but they shouldn't do that by changing the configuration of the javafx-maven-plugin. You'll probably loose the isolation of plugin contexts as Maven provides it. And maybe more important, answers via Google and Stack Overflow wouldn't work anymore.
Thanks for your reply, Robert!
Let me rephrase it: I don't want to have a monolithic plugin, and we did remove for good the "internal" use of the compiler plugin.
As a next step, I want to avoid the need of adding the Maven-compiler plugin to a user's pom whenever the JavaFX plugin is added, just because the default compiler version is 3.1, but we require 3.8.1.
Of course, if the user needs to do some changes in the default configuration of the compiler plugin, he/she would have to add it anyway, but in most of the cases that wouldn't be probably necessary (as you can always set the maven.compiler.source and alike properties without adding the plugin).
So my question is: what is the Maven way to enforce a newer version of the default plugins?
With this PR, we have just added the components.xml file, and I've seen that this file could be also used to override the default values of the plugins used in the default lifecycle. Is this wise? Is this the only way?
Thanks again!
With the 3.0 versions of our packaging-plugins (jar, war, ear, etc) we started moving the predefined plugin versions from Maven Core to their matching plugin. This will make that plugin responsible to update the plugin versions that are part of the lifecycle, and not Maven anymore.
JavaFX is a special type: it doesn't really need a special packaging type, because the jar lifecycle-bindings are good enough.
IF you really want, you could introduce your own packaging-type and define plugins+versions for every phase, but I'm not sure if that's worth it.
You could also decide to provide a parent with predefined version, but also with predefined plugin configuration. That's probably a lot easier to maintain and for most users easier to understand.