Alex Rivera | Logout

Maven - Error Releasing Code to GitHub (Hangs After Push)

Asked 2010-07-14T06:08:51.690
21

I'm attempting to run the mvn release:prepare goal and it's hanging after the push. Any idea what I could be doing wrong?

[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 <<<<

Below is the SCM section of my pom.xml:

<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>

Below is my .git/config:

[core]
    repositoryformatversion = 0
    filemode = true
    logallrefupdates = true
Edit
Report

2 Answers

5

Considering the source of git builtin-push.c, that means that somehow, no remote are defined for the local Git repo used by the maven script.

    static int do_push(const char *repo, int flags)
    {
        int i, errs;
        struct remote *remote = remote_get(repo);

        const char **url;
        int url_nr;


        if (!remote) {
            if (repo)
                die("bad repository '%s'", repo);
            die("No destination configured to push to.");
        }

As illustrated by this blog post, the maven config is not the all story.

~/foo/mikeci-archetype-springmvc-webapp$ git remote add origin git@github.com:amleggett/mikeci-archetype-springmvc-webapp.git

A remote add is still required, before specifying the maven scm parameters:

Updating the POM

For Maven to function effectively, you should always ensure that you include project VCS information in your POM file.
Now that we’ve added the archetype to a Git repository we can include the appropriate <scm> configuration:

  <scm>
   <connection>
   scm:git:ssh://github.com/amleggett/${artifactId}.git
   </connection>
   <developerConnection>
   scm:git:ssh://git@github.com/amleggett/${artifactId}.git
   </developerConnection>
   <url>
   http://github.com/amleggett/${artifactId}
   </url>
  </scm>

The same blog post adds:

It’s important to understand the meaning of each of the child elements of <scm>.

  • The <connection> elem
answered 2010-07-14T06:39:42.057
4

These are the exact sequence of commands I followed to get rid of this error

C:\Program Files (x86)\Git\bin>bash

bash-3.1$ eval 'ssh-agent -s'
SSH_AUTH_SOCK=/tmp/ssh-ZARFN11804/agent.11804; export SSH_AUTH_SOCK;
SSH_AGENT_PID=10284; export SSH_AGENT_PID;
echo Agent pid 10284;

bash-3.1$ exec ssh-agent bash
bash-3.1$ ssh-add "/c/Users/idntus/.ssh/id_rsa"
Enter passphrase for /c/Users/idntus/.ssh/id_rsa:
Identity added: /c/Users/idntus/.ssh/id_rsa (/c/Users/idntus/.ssh/id_rsa)

bash-3.1$ mvn release:prepare release:perform
answered 2013-06-07T09:24:21.137

Your Answer