-
Notifications
You must be signed in to change notification settings - Fork 77
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
Java FX projekt add dependency failed #864
Comments
Have you tried right click on the pom file and select Reload Project? |
Hello jdneo! Not before your message, but I tried. Of course it doesn't help. But I have since narrowed down the problem. The error only occurs with the latest version of Gson, which is: 2.11.0 The problem only occurs when I use JavaFX. I see that the point is not JavaFX, but the modular program (module-info.java). I'm writing a simple Maven project that works non-modularly on Gson 2.11.0. Let's stick with the modular JavaFX program: I looked into the Gson source code. Earlier versions of Gson are also modular. So it's not a problem. I see they introduced a new thing: proguard. I just suspect that might be causing the problem. I didn't go through it in detail. The concrete phenomenon: If you have this in pom.xml:
I have a line like this in the module-info.java file:
After the word requires, com.google.gson is underlined in red. If I move the mouse towards it, it says: ( |
Would you mind sharing a sample project for this issue? |
Here it is: Now, the Gson version is 2.11.0, so not working. https://central.sonatype.com/artifact/com.google.code.gson/gson |
Looks like it's a bug from upstream: Related issues: For now the workaround is to use [email protected] Sorry for the inconvenience. |
Thank you for your work! |
Since yesterday's "Project Manager for Java" release, additional dependencies added to JavaFX do not work.
I am making a Java FX project. This is based on Maven. It works.
When I add an extra dependency like Gson.
com.google.code.gson gson 2.11.0I write in the code:
Gson gson = new Gson();
I import as usual.
The dependency cannot be used. VSCode says Gson cannot be resolved. It is there in the pom.xml file, and the import is also there in the code.
I saw that other people had previously written that, due to modularization, the following must be entered in the module-info.java file:
requires com.google.gson;
But even this instruction gives me trouble, you can't even find the module here.
I used it 3 days ago and there were no problems with it.
The text was updated successfully, but these errors were encountered: