2017-09-25 62 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>