Using maven-release-plugin with GitHub “You can't push to git://github.com/…”

匿名 (未验证) 提交于 2019-12-03 03:08:02

问题:

Recently having switched source code repository for a project to GitHub from SourceForge I need to update the maven release process to match. I followed this link for configuring the "scm" section of the pom. The GitHub repository is shown here. Everything else is as it was when using SVN (for publishing to https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-4.MavenRepositories). So then I invoke

mvn clean release:clean release:prepare release:perform 

and the output is as follows

[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 

Now a connection of "scm:git:git://github.com/{organization}/{project}.git" is what all examples I've seen for maven-release-plugin so would appreciate any insight in why it doesn't work here, or what I could look at to find out why. I can do a git push to the same URL using the user I'm logged on here as (GitHub has the SSH key).

I tried swapping the scm connection/developerConnection over to https and then get username/password prompted and it then hangs (it updates the GitHub repo with the version without SNAPSHOT) but that's all.

回答1:

Actually the problem was more of believing web links of how you should configure your SCM section, so I post the answer here in case anyone else hits this message. The connection/developerConnection should be of the form

scm:git:git@github.com:{organization}/{project}.git 


回答2:

I was missing "scm:git:" in my pom.xml and was getting the following error. Adding it to my git url fixed it. Thanks for the help.

[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 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!