【发布时间】:2010-07-14 06:08:51
【问题描述】:
我正在尝试运行 mvn release:prepare 目标,但它在推送后挂起。知道我做错了什么吗?
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESSFUL
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 8 seconds
[INFO] [INFO] Finished at: Tue Jul 13 23:54:59 PDT 2010
[INFO] [INFO] Final Memory: 55M/294M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
[INFO] Working directory: C:\development\taylor\my-app
[INFO] Executing: cmd.exe /X /C "git status"
[INFO] Working directory: C:\development\taylor\my-app
[INFO] Executing: cmd.exe /X /C "git commit --verbose -F C:\Users\TAYLOR~1\AppData\Local\Temp\maven-scm-1932347225.commit pom.xml"
[INFO] Working directory: C:\development\taylor\my-app
[INFO] Executing: cmd.exe /X /C "git symbolic-ref HEAD"
[INFO] Working directory: C:\development\taylor\my-app
[INFO] Executing: cmd.exe /X /C "git push git@github.com:tleese22/my-app.git master:master"
[INFO] Working directory: C:\development\taylor\my-app
>>>> hangs here <<<<
下面是我的 pom.xml 的 SCM 部分:
<scm>
<connection>scm:git:git://github.com/tleese22/my-app.git</connection>
<developerConnection>scm:git:git@github.com:tleese22/my-app.git</developerConnection>
<url>http://github.com/tleese22/my-app</url>
</scm>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>
下面是我的 .git/config:
[core]
repositoryformatversion = 0
filemode = true
logallrefupdates = true
bare = false
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = git@github.com:tleese22/my-app.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = git@github.com:tleese22/my-app.git
这是 git show origin 的结果:
$ git remote show origin
Enter passphrase for key '/c/Users/Taylor Leese/.ssh/id_rsa':
* remote origin
Fetch URL: git@github.com:tleese22/my-app.git
Push URL: git@github.com:tleese22/my-app.git
HEAD branch: master
Remote branches:
gh-pages new (next fetch will store in remotes/origin)
master new (next fetch will store in remotes/origin)
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
$ git status
# On branch master
nothing to commit (working directory clean)
【问题讨论】:
-
上述 URL 是否在命令行中工作?
-
我也有这个问题;我认为它在等待密码时被卡住了。该问题仅限于 Windows,因为 Linux 可以缓存密码。我似乎无法找到为一般 scm 连接指定密码的方法。 (它清楚地记录了如何为站点分发之类的事情指定它们,但是该机制利用了一个 id - 并且 scm 标签没有一个 id。)
-
我最终使用了没有密码的密钥。
-
这对我有用:打开 git bash 并启动 ssh-agent:
..> eval $(ssh-agent -s)添加本地 .ssh 的密码:..> ssh-add准备发布:..> mvn release:prepare推送生成的标签 'myApp-1.0.0 ' 到远程仓库:..> git push origin myApp-1.0.0运行发布:..> mvn release:perform
标签: java git maven-2 github maven-release-plugin