-
Notifications
You must be signed in to change notification settings - Fork 35
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
Deprecation warnings prevent using GJF with Gradle 7 in projects that can't upgrade to Java 11 #59
Comments
Which version of the plugin are you using? 065ecdb (part of 0.9) should fix the deprecration warning. |
And also I don't have any control over what runtime requirements google-java-format has. This gradle plugin doesn't require JRE 11 (all the integration tests run fine on openjdk8 and oraclejdk8). Maybe try downgrading to an older version of google-java-format (with |
We tried 0.9 and it blew up with class-format exceptions due to running on Java 8, but perhaps something else is misconfigured. Will try again tomorrow. |
If you follow the instructions in the readme in https://github.com/jimshowalter/gjf-problem, you'll reproduce the problem we're seeing. If you can figure out what combination of configuration will make Java 8 work with the formatter and with Gradle 7.x, that would be great! |
Specifying toolVersion doesn't help. |
I really don't understand what's so complicated about this and why I am doing this now for you, but here you go:
|
Thank you! This undoubtedly seemed obvious to you, but the interactions among the settings is not obvious to an outsider. In particular, it wasn't clear which tool version to use for Java 8. This wouldn't be an entirely bad thing to include in your readme. |
Sorry, I didn't want to be rude, it's just really annoying when people open and comment in multiple issues [1] to make absolutely sure that they are heard and get help from someone, instead of (and this is what open source is about) trying to understand and fix the problem themselves (and for others, by contributing back). I have enough of these kind of bug reports at work. I can see now that you have put in some effort at least (creating an example project), but if you had read my comments and the README carefully, you would have known that setting That being said, you are right that it wouldn't be an entirely bad thing to say a word or two about google-java-format potentially having different (stricter) runtime requirements (documented in their release notes: https://github.com/google/google-java-format/releases). Feel free to open a pull request 😉 . [1] #59, #58, google/google-java-format#593, google/google-java-format#602 |
Didn't take it as rude, and greatly appreciated getting it unsnarled. We are now running with Gradle 7.0 (the latest), Java 8, and your plugin. |
- Update format with sherter.google-java-format 0.9 - Use and reformat with earlier googleJavaFormat ¯\_(ツ)_/¯ `https://github.com/sherter/google-java-format-gradle-plugin/issues/59`
- Update format with sherter.google-java-format 0.9 - Use and reformat with earlier googleJavaFormat ¯\_(ツ)_/¯ `https://github.com/sherter/google-java-format-gradle-plugin/issues/59`
Updated Gradle from 6.9.2 to 7.3.3, started getting same error: `* What went wrong:
|
Did you follow the configuration info @sherter gave above? We followed it and are un 7.3.3 with the GJF plugin, and everything works fine. |
the one thing worked for me - I downgraded toolVersion to 1.7 (using GJF v 0.9) sorry, which configuration do you mean? |
Scroll up: #59 (comment) |
…sion of GJF gradle plugin (formatter version stays the same). Verified by messing up some code running gradlew googleJavaFormat.
Once you made the minimum Java runtime version be 11, a huge number of legacy Java projects (which probably means about 95% of all Java code every written!) were unable to use newer versions of GJF.
Unfortunately, older versions of GJF have deprecation warnings in Gradle 6.x that are now forbidden in Gradle 7.x.
So, it's a Catch-22. Projects either need to 1) stop using GJF, or 2) not upgrade Gradle.
Both of those are horrible options.
Please please please cut a release of GJF that is compatible with Java 8 and removes the deprecations.
Also, is there some way projects stuck in this situation can override the ignoreFailures property in their own Gradle build files to not have redundant getters?
The text was updated successfully, but these errors were encountered: