与CircleCI一起使用时,maven-release-plugin出现问题

时间:2018-10-12 06:42:41

标签: maven circleci

我正在尝试使用maven-release-plugin发行到Nexus发行版本存储库,并且当我在PC上本地运行时,这工作正常。但是,当我在circleci中的工作中配置了相同的内容时,出现以下错误。

[INFO] Executing: /bin/sh -c cd /home/circleci/repo && git commit --verbose -F /tmp/maven-scm-724046220.commit pom.xml
[INFO] Working directory: /home/circleci/repo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.414 s
[INFO] Finished at: 2018-10-11T17:00:30Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project : 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: empty ident name (for <(null)>) not allowed
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 

我在pom.xml中使用了以下scm(因为格式问题我没有给出xml)

<scm>
        <connection>scm:git:git@bitbucket.org:organization/project.git</connection>
        <url>scm:git:git@bitbucket.org:organization/project.git</url>
        <developerConnection>scm:git:git@bitbucket.org:organization/project.git</developerConnection>
        <tag>@{project.version}</tag>
</scm>

我正在使用以下命令呼叫我的工作-

mvn release:clean release:prepare release:perform -DreleaseVersion=${BUILD_VERSION_NUM} -DupdateWorkingCopyVersions=false -Dtag=${VERSION_NUM}

任何建议,为什么git-commit命令在circleci中失败。我必须做的任何特定设置。

非常感谢, 苏吉特

1 个答案:

答案 0 :(得分:0)

如果要拉/推到不是CircleCI构建的当前版本的GitHub存储库,则需要设置部署或用户密钥:https://circleci.com/docs/2.0/gh-bb-integration/#creating-a-github-user-key