Home > Software design >  Maven writes \u0000 into resolver-status.properties files, failing subsequent builds
Maven writes \u0000 into resolver-status.properties files, failing subsequent builds

Time:01-21

I am using MacOS and I am using Maven in version 3.8.7. I am using Java in 11.0.17 by Eclipse Temurin.

Somehow, when building a big Maven project, Maven creates resolver-status.properties files that contain invalid characters:

.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:3:\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:4:maven-metadata-willhaben-ne\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
.m2/repository/some-project/1.0-SNAPSHOT/resolver-status.properties:8:maven-metadata-shibboleth-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=

A subsequent Maven build is then failing with this error message:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.281 s
[INFO] Finished at: 2023-01-17T09:19:29 01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Malformed \uxxxx encoding.
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

The error is happening when I run Maven both with one thread and with multiple threads.

How can I fix my build so that Maven no longer writes \u0000 in resolver-status.properties files?

CodePudding user response:

I know suspect that the broken files get downloaded from Nexus when performing the Maven build anew.

On our CI they are built with a somewhat older Maven version and with multiple threads.

  • Related