mschonaker / wagon-git

Git Wagon for Apache Maven
http://synergian.github.io/wagon-git/
83 stars 32 forks source link

wagongit: Unable to create branch #21

Closed pulkitsinghal closed 10 years ago

pulkitsinghal commented 10 years ago

I had everything working with wagon-git perfectly for a few days, given the following config:

    <extensions>
        <extension>
            <groupId>ar.com.synergian</groupId>
            <artifactId>wagon-git</artifactId>
            <version>0.2.1</version>
        </extension>
    </extensions>
...
<pluginRepositories>
    <pluginRepository>
        <id>synergian-repo</id>
        <url>https://raw.github.com/synergian/wagon-git/releases</url>
    </pluginRepository>
</pluginRepositories>
<distributionManagement>
    <repository>
        <id>my-maven-repo</id>
        <name>my-maven-repo</name>
        <url>git:releases://git@bitbucket.org:myUserName/my-maven-repo.git</url>
    </repository>
</distributionManagement>

So I'm not quite sure what changed after a reboot, perhaps a session expired that I should have configured explicitly ... I don't know ... this is what I see now when I run mvn clean deploy now:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project XXX: Failed to deploy artifacts: Could not transfer artifact XXX from/to XXX (git:releases://git@bitbucket.org:XXX/XXX.git): Unable to pull git repository: Unable to create branch
...
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.fermyon:router-commons:jar:1.4.4 from/to xxx-maven-repo (git:releases://git@bitbucket.org:xxx/xxx-maven-repo.git): Unable to pull git repository: Unable to create branch
...
Caused by: org.apache.maven.wagon.ConnectionException: Unable to pull git 
...
Caused by: ar.com.synergian.wagongit.GitException: Unable to create branch

Any suggestions as to what could be wrong? Is this a bug? I had NOT configured ~/.m2/settings.xml last time for publishing when it all just worked ... and now when I try configuring it ... the error show up with or without it.

pulkitsinghal commented 10 years ago

I ran the command with -Dwagon.git.debug=true and here's the relevant gist: https://gist.github.com/pulkitsinghal/8074867

mschonaker commented 10 years ago

Please try again removing this directory manually first: /var/folders/bl/hw7sxsj97vjdqvtjqn1707wh0000gr/T/wagon-git-88479be8483e93e05585a29708d4f7dad413f4ef

pulkitsinghal commented 10 years ago

That seems to have done the trick! What was it about?

mschonaker commented 10 years ago

In order to avoid downloading the target repository over and over, the wagon computes a hash on the remote address and uses it as a the name of the local directory.

Somehow, your directory looks like being in an inconsistent state (created, but no git repo inside).

Spettacolo83 commented 4 years ago

In my case it was a different directory: /var/folders/hy/n1d29m9x7qv5st1yj_dpw1gw0000gn/T/wagon-git-**