Skip to content

Make spotless a convention plugin, and fix google java format issue #3473

@bric3

Description

@bric3

After #3446, Spotless is still applied in the root subproject section. This should be converted to a convention plugin.

Also, we need to fix the issue with googlejavaformat on JDK 21.

> Task :mockito-core:spotlessJava FAILED
Step 'google-java-format' found problem in 'src/main/java/org/mockito/invocation/DescribedInvocation.java':
class com.google.googlejavaformat.java.JavaInput (in unnamed module @0xfe86b99) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0xfe86b99
java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0xfe86b99) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0xfe86b99
        at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:350)
        at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:335)
        at com.google.googlejavaformat.java.JavaInput.<init>(JavaInput.java:277)
        at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:260)
        at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:247)
        at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:213)
        at com.google.googlejavaformat.java.Formatter$formatSource$0.call(Unknown Source)
        at spotless_c497s6tbmd544d1gnegbe7k20$_run_closure1$_closure2$_closure3.doCall$original(/Users/brice.dutheil/opensource/mockito/gradle/spotless.gradle:27)
        at spotless_c497s6tbmd544d1gnegbe7k20$_run_closure1$_closure2$_closure3.doCall(/Users/brice.dutheil/opensource/mockito/gradle/spotless.gradle)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions