Maven Deploy 无法解析元数据

Maven Deploy failing to parse metadata

尝试将更改上传到私有 bitbucket 存储库并收到以下错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.538 s
[INFO] Finished at: 2017-09-25T12:40:40-04:00
[INFO] Final Memory: 24M/327M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project commonfiles: Failed to update metadata commonfiles:commonfiles/maven-metadata.xml: Could not parse metadata /path-to-maven-repository/maven-metadata-commonfiles.xml: unexpected character in markup < (position: END_TAG seen ...</versions>\n<<... @10:3) -> [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/MojoExecutionException

打开元数据文件,我可以看到一些 Git 风格的头部标记使 XML 无法解析。

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>commonFiles</groupId>
  <artifactId>CommonFiles</artifactId>
  <versioning>
    <release>0.3</release>
    <versions>
      <version>0.3</version>
    </versions>
<<<<<<< HEAD
    <lastUpdated>20170922183241</lastUpdated>
=======
    <lastUpdated>20170922184047</lastUpdated>
>>>>>>> 2eef4b2ec679542fd7e996341a0913500cd117df
  </versioning>
</metadata>

作为参考,我使用的是最新版本的 wagon-git 和 maven 3.3.9.

以前我看到这个错误偶尔会弹出,并且能够通过删除元数据文件并重新部署来修复。现在已经尝试了几次,似乎没有任何改变。任何帮助将不胜感激。

您正在查看的文件有未解决的冲突,因为您可能已将拉取到当前分支。

您需要按照以下步骤操作:

  1. 解决所有具有冲突代码的文件中的冲突。

    <versioning>
         <release>0.3</release>
         <versions>
              <version>0.3</version>
         </versions>
         <lastUpdated>20170922184047</lastUpdated> 
         <!-- I've for example accepted the current change-->
    </versioning>
    
  2. 提交并推送已解决的更改

    git commit -am "sample"
    git push origin <yourBranch>