Skip to content
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

[gradle-plugin]: Latest update (5.5.0) is broken on JDK loom eap builds #693

Closed
6 tasks done
sureshg opened this issue Sep 12, 2020 · 2 comments · Fixed by #694
Closed
6 tasks done

[gradle-plugin]: Latest update (5.5.0) is broken on JDK loom eap builds #693

sureshg opened this issue Sep 12, 2020 · 2 comments · Fixed by #694
Labels

Comments

@sureshg
Copy link

sureshg commented Sep 12, 2020

  • summary of problem
    This commit is broken on JDK loom EAP builds (java.lang.StringIndexOutOfBoundsException). The plugin was working fine on all JDK eap versions, including project loom . The version format used is,
$ java -version    
openjdk version "16-loom" 2021-03-16
OpenJDK Runtime Environment (build 16-loom+6-105)
OpenJDK 64-Bit Server VM (build 16-loom+6-105, mixed mode, sharing)

Is it possible to handle the EAP version also?

  • gradle or maven version
    • 6.7-rc-1
  • spotless version
    • 5.5.0
  • operating system and version
    • Mac OSX (10.13.6)
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
spotless {
    java {
        googleJavaFormat(Versions.googleJavaFormat)
    }
  kotlin {
        ktlint(Versions.ktlint).userData(mapOf("disabled_rules" to "no-wildcard-imports"))
        targetExclude("$buildDir/**/*.kt", "bin/**/*.kt")
        // licenseHeader(License.Apache)
    }
  kotlinGradle {
        ktlint(Versions.ktlint).userData(mapOf("disabled_rules" to "no-wildcard-imports"))
        target("*.gradle.kts")
    }
  format("misc") {
        target("**/*.md", "**/.gitignore")
        trimTrailingWhitespace()
        endWithNewline()
    }
 }
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 7
        at com.diffplug.spotless.java.GoogleJavaFormatStep.<clinit>(GoogleJavaFormatStep.java:84)
        ... 199 more
@nedtwigg nedtwigg added the bug label Sep 12, 2020
@nedtwigg
Copy link
Member

Ah, this should be easy to fix.

@nedtwigg
Copy link
Member

Thanks for reporting. Fixed in plugin-gradle 5.5.1 and plugin-maven 2.3.1

connoratrug added a commit to molgenis/molgenis-emx2 that referenced this issue Jun 10, 2021
add work around for gradle spotless plugin
see details at: diffplug/spotless#693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants