2013-12-14 33 views
5

最近有一個項目從SourceForge切換到GitHub的源代碼存儲庫我需要更新maven版本進程匹配。我跟着this link配置了pom的「scm」部分。 GitHub存儲庫是shown here。其他的一切和使用SVN時一樣(發佈到https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-4.MavenRepositories)。於是我調用在GitHub中使用maven-release-plugin「你不能推送到git://github.com/...」

mvn clean release:clean release:prepare release:perform 

和輸出如下

[INFO] --- maven-release-plugin:2.1:prepare (default-cli) @ datanucleus-maven-parent --- 
[INFO] Verifying that there are no local modifications... 
[INFO] ignoring changes on: pom.xml.next, release.properties, pom.xml.releaseBackup, pom.xml.backup, pom.xml.branch, pom.xml.tag 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git status 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] Checking dependencies and plugins for snapshots ... 
What is the release version for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) 3.3: : 
What is SCM release tag or label for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) datanucleus-maven-parent-3.3: : 
What is the new development version for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) 3.4-SNAPSHOT: : 
[INFO] Transforming 'DataNucleus Maven parent project'... 
[INFO] Not generating release POMs 
[INFO] Executing goals 'clean verify'... 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && /usr/local/maven3/bin/mvn clean verify --no-plugin-updates -Psonatype-oss-release -P development 
    [WARNING] Command line option -npu is deprecated and will be removed in future Maven versions. 
    [INFO] Scanning for projects... 
    [INFO]                   
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Building DataNucleus Maven parent project 3.3 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] 
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ datanucleus-maven-parent --- 
    [INFO] Deleting /home/andy/work/datanucleus/datanucleus-maven-parent (includes = [*.log], excludes = []) 
    [INFO] 
    [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ datanucleus-maven-parent --- 
    [INFO] 
    [INFO] --- maven-bundle-plugin:2.4.0:manifest (default) @ datanucleus-maven-parent --- 
    [WARNING] Ignoring project type pom - supportedProjectTypes = [jar, bundle] 
    [INFO] 
    [INFO] --- maven-source-plugin:2.1.2:jar-no-fork (attach-sources) @ datanucleus-maven-parent --- 
    [INFO] 
    [INFO] --- maven-javadoc-plugin:2.7:jar (attach-javadocs) @ datanucleus-maven-parent --- 
    [INFO] Not executing Javadoc as the project is not a Java classpath-capable package 
    [INFO] 
    [INFO] --- maven-gpg-plugin:1.1:sign (sign-artifacts) @ datanucleus-maven-parent --- 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD SUCCESS 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 1.535s 
    [INFO] Finished at: Sat Dec 14 08:51:07 GMT 2013 
    [INFO] Final Memory: 14M/491M 
    [INFO] ------------------------------------------------------------------------ 
[INFO] Checking in modified POMs... 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git add -- pom.xml 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git status 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git commit --verbose -F /tmp/maven-scm-1907822841.commit pom.xml 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git symbolic-ref HEAD 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git push git://github.com/datanucleus/datanucleus-maven-parent.git master:master 
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 6.885s 
[INFO] Finished at: Sat Dec 14 08:51:07 GMT 2013 
[INFO] Final Memory: 15M/491M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare (default-cli) on project datanucleus-maven-parent: Unable to commit files 
[ERROR] Provider message: 
[ERROR] The git-push command failed. 
[ERROR] Command output: 
[ERROR] fatal: remote error: 
[ERROR] You can't push to git://github.com/datanucleus/datanucleus-maven-parent.git 
[ERROR] Use https://github.com/datanucleus/datanucleus-maven-parent.git 

現在的「供應鏈管理的連接:/(項目)git的//github.com/ {}組織:混帳:混帳「是我見過的所有關於maven-release-plugin的例子,所以我將非常感謝爲什麼它不能在這裏工作,或者我可以查看原因。我可以使用我在此處登錄的用戶(GitHub具有SSH密鑰)對同一個URL執行git推送。

我試圖將scm連接/ developerConnection交換到https,然後獲取用戶名/密碼提示,然後掛起(它更新GitHub回購版,但沒有SNAPSHOT的版本),但僅此而已。

+2

除此之外,我會建議使用最新的maven-release-plugin(2.4.2)而不是舊的(2.1)。 – khmarbaise

+0

yes同意,但在Sonatype父POM中爲發佈到Sonatype的所有項目指定(即使我可以覆蓋它) – DataNucleus

回答

9

實際上問題更多的是相信你應該如何配置你的SCM部分的網絡鏈接,所以我在這裏發佈答案,以防其他人點擊這條消息。連接/ developerConnection應該是這樣的形式

scm:git:[email protected]:{organization}/{project}.git 
+0

它沒有爲我工作。我得到了推送失敗,並顯示「沒有找到支持的身份驗證方法(服務器發送公鑰)」對話框,您能幫我解決這個錯誤嗎? –

+1

它對我有用(我有https://版本)@coding_idiot,你有沒有添加你的公共ssh密鑰到你的github賬戶? – emicklei

+0

你救了我一天,謝謝一堆 – nilesh

0

我失蹤了「供應鏈管理:git的:」在我的pom.xml,並得到以下錯誤。將它添加到我的git url修復了它。謝謝您的幫助。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.2:prepare (default-cli) on project account-creation: Unable to commit files 
[ERROR] Provider message: 
[ERROR] The git-push command failed. 
[ERROR] Command output: 
[ERROR] Permission denied (publickey). 
[ERROR] fatal: The remote end hung up unexpectedly 
[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