簡體   English   中英

Maven版本:准備無法提交父模塊

[英]Maven release:prepare cannot commit parent module

我要分兩個步驟使用Maven發布插件進行發布:

1. mvn clean release:prepare
2. mvn release:perform

在最近的兩個發行版中,它運行良好,但是將我的IDE從intellij更改為eclipse之后,我無法使用apache-maven 3.5.3和eGit 4.9.2進行發行。

我的項目的總體結構為:

parent-dir
    -> pom.xml
    -> child1-dir
           -> pom.xml
    -> child2-dir
           -> pom.xml

child1和child2包含代碼和包裝到jar ,父母有包裝目標pom 在父pom.xml中配置maven-release-plugin:

      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.1</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.shared</groupId>
                    <artifactId>maven-invoker</artifactId>
                    <version>2.2</version>
                </dependency>
            </dependencies>
        </plugin>

該插件會使用正確的版本號更新所有pom,提交更改並推送到兩個子模塊的遠程存儲庫。 但是對於父模塊,在日志末尾會出現以下錯誤:

[INFO] Reactor Summary:
[INFO] 
[INFO] test Parent 0.12-SNAPSHOT ........................ FAILURE [02:46 min]
[INFO] test Child1 ...................................... SUCCESS [  0.011 s]
[INFO] test Child2 0.12-SNAPSHOT ........................ SUCCESS [  0.205 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:48 min
[INFO] Finished at: 2018-09-08T12:56:06+02:00
[INFO] ------------------------------------------------------------------------    
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project test-parent: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] git@github.com: Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR] 
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[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

我不明白為什么在成功提交並推送子模塊后會收到此錯誤消息?

您需要在Github中添加公鑰。

如需幫助,請參閱https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM