-
Notifications
You must be signed in to change notification settings - Fork 66
proper toolchain support #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Please, can you create an issue that justifies this PR, describing what is failing and what this PR solves? |
This is not as much a problem solving as it is an improvement; the plugin did not support toolchains (even though the source code suggested this: getLog().debug("Toolchains are ignored, 'executable' parameter is set to " + executable) ). However, what can fail is that the compiler plugin can use a different JDK from the javafx:run. The compiler has a pretty complex determine-the-javac logic, while this plugin simply uses the java.exe on the system path. This manifested itself when I ran "clean javafx:run" from Eclipse; maven was ran with Java 15 (as configured in Eclipse), while javafx:run used Java 11 (which was used to start Eclipse). So I got a class version exception. You can set the executable manually, but that would mean hardcoding or some variable. I solved this by making my pom toolschain aware. |
Issue 124 |
Hi @tbee , Thank you for this PR. I applied this patch and build a new plugin version. However, it doesn't resolve the issue. Can you please guide me through the process? Here are the steps I followed to test:
Debug log (snipped):
|
You need to configure Maven toolchains.
Now the compiler and javafx:run will use the same jdk. |
Hi @tbee, Alright. This works! However, there is still this manual configuration that the user has to do by setting the toolchain plugin. Is it possible for |
This PR is about adding toolchains support to the plugin. I did take a look at copying the whole javac detection logic from the compiler plugin, but that is not quite trivial. In the end toolchains is the formal way to support these overarching tool concerns: The Maven Toolchains provide a way for plugins to discover what JDK (or other tools) are to be used during the build, without the need to configure them in each plugin nor in every pom.xml. That said, I could take a peek if I can get the non-toolchain behavior closer to that of the compiler-plugin. |
Sounds great! This PR is good in its current state. ` |
Fix #124