ZIP_Read: error reading zip file

I’m having sometimes an issue on running mvn scanner (seems to be completely random):

[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version ( 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=17ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=4ms
[INFO] Java Main Files AST scan
[INFO] 38 source files to be analyzed
[ERROR] Unable to run check class - S1640 on file /var/lib/jenkins/jobs/[...].java, To help improve SonarJava, please report this problem to SonarSource : see
java.lang.RuntimeException: ZIP_Read: error reading zip file

This is just an example, as most of the times I have between 5 and 10 similar errors on a single build.
Sometimes, I also have another similar issue:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project [...]: Can not create ClassLoader: Unable to open /var/lib/jenkins/.m2/repository/[...]-2.10-SNAPSHOT.jar: zip file is empty -> [Help 1]

I don’t know if those 2 errors could be related. I checked the file and they exists (at least now). Is it possible to tell sonar just to ignore (or warn) these cases instead of stopping the build?

Thanks id advance!

  • versions used
    • SonarQube: 6.7.3 (build 38370)
    • Scanner: 2.4.4 (quite an old version, but last available for our jenkins)