-
Notifications
You must be signed in to change notification settings - Fork 463
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
removeUnusedImports does not work on Java 9 #83
Comments
I'm not entirely surprised that it failed. Spotless's It's not clear to me that there's anything we can do, other than create a custom step that removes unused imports, or to find another library which lets us to remove unused imports. |
Agreed. Until google-java-format supports Java 9, this will be an unfixable bug for us. We'll update this issue when that changes. |
No worries. This is not a blocker for us at the moment. I just wanted you guys know. |
Class "Someone" has to declare the usage of module java.compiler somewhere:
|
@sormuras Declaring usage of "java.compiler" is something we could do if google-java-format itself doesn't, but I personally have very little knowledge of Jigsaw modules, so although I gather that it would involve us creating at least one |
Any updates on Java 9 support? I see that Spotless uses google-java-format 1.3 while maven central has version 1.5: https://search.maven.org/#artifactdetails%7Ccom.google.googlejavaformat%7Cgoogle-java-format%7C1.5%7Cjar |
@cobexer I don't know about Java 9 support, but I do know that Spotless can and does support google-java-format 1.5, even if it's not the default version yet. To use 1.5, set your Spotless config as follows. spotless {
java {
googleJavaFormat('1.5')
}
} |
@jbduncan I didn't notice that, however it also doesn't change the error =( |
@cobexer I admit that I'm really puzzled by this error. I get the same error that @marcphilipp reported in his initial message when I run @sormuras, if we wanted to declare the usage of module java.compiler in Spotless when running on Java 9+, do you know how we could go about doing so? |
As of Spotless |
I just verified removeUnusedImports works on Gradle 5.4.1 w/ Java 11.0.4 and spotless 3.24.1! |
Thanks for the verification! |
see https://travis-ci.org/junit-team/junit5/jobs/209088615
The text was updated successfully, but these errors were encountered: