1

I have a problem with task :jacocoTestReport. gradle clean build task for my Gradle Java project (Spring Boot) failed with error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jacocoTestReport'.
> java.lang.IllegalArgumentException: malformed input off : 17, length : 1

I have chcp1251 archives files in my test resource and resource folders: image with project structure

And I think it's cause of jacoco task failed, but I'm my not sure. Here is my build.gradle file:

plugins {
    id "java"
    id "idea"
    id "groovy"
    id "jacoco"

...

test {
    useJUnitPlatform()
    finalizedBy jacocoTestReport
}

jacocoTestReport {
    dependsOn test

    reports {
        html.enabled false
        xml.enabled true
    }
}

Can you help me with this problem, please? Maybe I cant set charset for jacoco?

samabcde
  • 6,988
  • 2
  • 25
  • 41
Galua
  • 11
  • 3

1 Answers1

0

jacoco doesn't support encoding not in UTF-8. I recreate my archive in test resource folder with new name without spaces and cyrillic symbols. And it's works fine.

Update (2023-02-26). Also I removed my chcp1251 files from build in build.gradle via:

sourceSets {
    main {
        resources {
            exclude '**/*.edt' // file extension of my `chcp1251` archives
        }
    }
}
Galua
  • 11
  • 3