-
Notifications
You must be signed in to change notification settings - Fork 64
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
Breaks with JDK 16 #99
Comments
#100 will fix it just need a release. and add documentation because https://github.com/google/google-java-format/releases/tag/v1.10.0 need more java flags due to JEP 396: Strongly Encapsulate JDK Internals by Default
|
#100 is merged and version 2.11 is released, but the problem with the options still prevail. Assuming that forking and setting jvmargs for this plugin is a lot of work @malaporte ? |
Upgrading |
|
I would say that 1.11.0 of the google-java-format does not help with the required commandline options, but it has other improvments. |
I was referring to 1.11.0 |
I just release 2.12 which uses the latest Google Java Format version, but as mentioned above you still need to pass all the annoying options to Maven for it to work. I started a branch to experiment with running the formatter in a child process, but as of now I have yet to figure out how to extract the right class path from the class loader that Maven is using (using the "all deps" version of Google Java Format would fix the problem, but it's not available on Maven meh). |
@malaporte if you're successful with the fork approach, can you please make this an optional feature? Forking does have some performance impact, and some users will have instead solved the problem by adding the aforementioned flags to |
Oh definitively - I was intending on doing that only for Java >= 16, and if possible check for the presence of the required flag to see if running in-process is an option. |
Any update on this @malaporte ? |
I'm seeing it there now. |
@malaporte Have you looked more into this? |
I solved this by using instructions in README: https://github.com/spotify/fmt-maven-plugin#using-with-java-16-and-maven Added file
|
Readme updated in #117 We intend to also add forking support to the plugin, so you can specify these flags in a better way, or preferably include them in the plugin itself. (If it's not fixed in google-java-format before then) |
JVM config is needed for spotify/fmt-maven-plugin#99 / google/google-java-format#787
JVM config is needed for spotify/fmt-maven-plugin#99 / google/google-java-format#787
Describe the bug
Using this plugin with JDK16 fails because
com.sun.tools.javac.parser.Tokens$TokenKind
is not accessible anymore:To Reproduce
Run a Maven build using this plugin with OpenJDK 16.
Expected behavior
The code get formatted without an error.
Additional context
Builds with OpenJDK 15 work fine. Cause for this error are likely changes for JEP 396: Strongly Encapsulate JDK Internals by Default.
Corresponding Ticket for Google Java Format: google/google-java-format#538
The text was updated successfully, but these errors were encountered: