2017-09-25 26 views
0

试图改变上传到私人到位桶回购并得到以下错误:Maven的部署无法解析的元数据

[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。

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

回答

0

您正在查看的文件有未解决的冲突因为您可能已经将您吸入当前分支。

您需要按照步骤操作:在所有这些有冲突的代码文件

  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>