Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven deploy hangs while downloading maven_metadata.xml if it exists already

I have configured my project to be deployed to my own repository. When I run mvn deploy it looks like it's working but hangs at the stage for downloading the maven_metadata.xml file to after it's uploaded the jars.

INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ myproject ---
Uploading: scp://myrepodomain/.../myproject-0.06-2.jar
Uploaded: scp://myrepodomain/.../myproject-0.06-2.jar (39013 KB at 6234.1 KB/sec)
Uploading: scp://myrepodomain/.../myproject-0.06-2.pom
Uploaded: scp://myrepodomain/.../myproject-0.06-2.pom (8 KB at 21.6 KB/sec)
Downloading: scp://myrepodomain/.../maven-metadata.xml 
320/319 B
.....here is where it just hangs forever

If I delete the maven-metadata.xml file on the server, it works fine and just uploads a freshly generated one.

I should also mention that I am just using a simple HTTP server with SCP, I find the larger artifact systems to be way overkill for what I am doing. I can't figure out how to even debug this. Any suggestions would be appreciated.

like image 726
samsquanch Avatar asked Dec 09 '13 21:12

samsquanch


2 Answers

With OS/X 10.9.3 and Maven 3.2.3, I had the same issue.

It seems to be the wagon plugin which is broken when downloading the files during the deploy.

I solved it by switching the wagon connector to "Maven Wagon SSH External" in order to use the system ssh command.

Below my POM.xml modification :

        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>2.6</version>
        </extension>

switched to :

        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh-external</artifactId>
            <version>2.6</version>
        </extension>

And replaced

    scp://[email protected]

By

    scpexe://[email protected]

into url tags :

    <repository>
        ...
        <url>scpexe://[email protected]</url>
        ...
    </repository>
like image 165
bruno Avatar answered Oct 04 '22 19:10

bruno


I have managed to fix this by swapping all references of scp to sftp in my pom.xml. The advantage of this solution is it does not require any additional configuration. See http://jira.codehaus.org/browse/MNG-5605 for more information.

like image 31
grandwazir Avatar answered Oct 04 '22 18:10

grandwazir