最近从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)。那么我调用
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
现在连接“scm:git:git://github.com/ {organization} / {project} .git”就是我在maven-release-plugin中看到的所有示例所以会很感激为什么它在这里不起作用,或者我可以看到以找出原因。我可以使用我在这里登录的用户对git推送到同一个URL(GitHub有SSH密钥)。
我尝试将scm connection / developerConnection交换到https,然后提示输入用户名/密码,然后挂起(它使用没有SNAPSHOT的版本更新GitHub仓库),但这就是全部。
答案 0 :(得分:10)
实际上问题是更多地相信你应该如何配置SCM部分的网络链接,所以我在这里发布答案以防其他人点击此消息。 connection / developerConnection的格式应为
scm:git:git@github.com:{organization}/{project}.git
答案 1 :(得分:0)
我在我的pom.xml中缺少“scm:git:”并且收到以下错误。将它添加到我的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