无法提交文件

Unable to commit files

当我们在 Jenkins 工具中为项目 [employee-model] 执行 Maven 发布时出现以下错误。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project employee-model: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-commit command failed.
[ERROR] Command output:
[ERROR] 
[ERROR] *** Please tell me who you are.
[ERROR] 
[ERROR] Run
[ERROR] 
[ERROR] git config --global user.email "you@example.com"
[ERROR] git config --global user.name "Your Name"
[ERROR] 
[ERROR] to set your account's default identity.
[ERROR] Omit --global to set the identity only in this repository.
[ERROR] 
[ERROR] fatal: unable to auto-detect email address (got 'jenkins@ip-xx-xx-xx-xx.(none)')
[ERROR] -> [Help 1]
[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.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[JENKINS] Archiving /var/lib/jenkins/jobs/Reconciliation-release-employee-model/workspace/cm

您的问题似乎不是 Jenkins,而是 git 帐户。 从 OS 首先尝试 运行,作为 jenkins 用户(假设 linux):

cd .../path/to/project/
git push

您将收到相同的错误消息:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

按照建议发出 'git config' 命令并尝试再次推送。如果它修复了 - 从 Jenkins 也应该没问题。