Chinese characters in a file name
We are trying to build a node project where some of the node modules downloaded have files that have chinese characters in them. That resulted in the following exception during building of the maven project that has git-commit-id plugin: [ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.4:revision (default) on project mapanelweb: Could not complete Mojo execution... Malformed input or input contains unmappable characters: /home/ec2-user/workspace/eis-mapanel-cloud8/source/service/node_modules/http-server/node_modules/ecstatic/test/public/?????? -> [Help 1]
Expected Behavior
The build should not fail with the above error
Current Behavior
Our project build is failing in the Jenkins server with the following exception: [ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.4:revision (default) on project mapanelweb: Could not complete Mojo execution... Malformed input or input contains unmappable characters: /home/ec2-user/workspace/eis-mapanel-cloud8/source/service/node_modules/http-server/node_modules/ecstatic/test/public/?????? -> [Help 1]
The same build is going fine in my laptop
Steps to Reproduce (for bugs only)
Environment (for bugs only)
This issue is only observed during the building of our node js project in the Jenkins server. If I attempt the same build in my laptop, I am not seeing any issues.
Based on a quick research on the internet that might be a Java bug and not specifically related to this plugin (google for Malformed input or input contains unmappable characters).
Try to set the following (on the jenkins instance) before you run maven:
export JAVA_OPTS="-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Have you by any chance also set
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
inside your pom?
Assuming it was not a bug in the plugin, if you still have the issue feel free to reopen.
I ran into this issue too with a repository that contained filenames with non-ASCII characters while using maven inside of Docker. Maven outside of Docker on my Mac with same repo worked fine. I assume the Docker image (gcr.io/cloud-builders/java/mvn@sha256:3883d069649a6d31526954f7f888ae9839dccff2212a030e26e0eea2a1e7287b) is missing some kind of config so some Java setting defaults to ASCII, and then JGit parses all of the filenames in the git repo as strings and fails. I tried all of your suggestions (together, and then individually) and they didn't fix it. Setting useNativeGit to true fixed it though.
Thanks for the input and further details, I'll look into that.
Mhhh, when trying to download the image I just get Image not found. maybe it was corrupted? How can I check what happened to the image?
Hmm, I think Google published a newer image and took down the specific version I linked. I don't expect that the exact version is necessary; the version I was using was from a few days ago so I expect the current one at gcr.io/cloud-builders/java/mvn to act the same.