Deploy to maven repo with SSH

Can anyone please tell me what is wrong with my build.gradle file? It seems to me I have followed the docs correctly but I always get error message:

Failed to deploy artifacts/metadata: No connector available to access repository remote (scp://dev.mysite.net.au/srv/repo/snapshots) of type default using the available factories WagonRepositoryConnectorFactory

Here is my file:

apply plugin: 'java'
apply plugin: 'maven'

group = 'com.mygroup'
version = '1.1.3-SNAPSHOT'

description = 'My Project'

sourceCompatibility = 1.7
targetCompatibility = 1.7

configurations {
    deployerJars
}

repositories {
    mavenCentral()
    maven {
        url "http://repo.mysite.net.au/maven"
        credentials {
            username devUser
            password devPassword
        }
    }
}

dependencies {
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5'
    compile group: 'com.googlecode.jsendnsca', name: 'jsendnsca', version: '2.0.1'
    compile group: 'commons-codec', name: 'commons-codec', version: '1.9'
    compile(group: 'commons-configuration', name: 'commons-configuration', version: '1.10') {
        exclude(module: 'commons-logging')
    }
    runtime(group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.2') {
        exclude(module: 'commons-logging')
    }
    runtime group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.5'
    testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.2'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
}

uploadArchives {
    repositories.mavenDeployer {
        configuration = configurations.deployerJars
        repository(url: 'scp://dev.mysite.net.au/srv/repo/maven') {
            authentication(userName: devUser, privateKey: rsaKey)
        }
        snapshotRepository(url: 'scp://dev.mysite.net.au/srv/repo/snapshots') {
            authentication(userName: devUser, privateKey: rsaKey)
        }

    }
}

I have the same problem after switching to gradle 2.6 (also 2.5 does not work)

After I switched back to 2.1 it works fine. Therefore in one of the newer gradle version there is a problem with the wagon-ssh as it looks.

Wow you are right thanks! I changed to version 2.1 and it works fine, you saved me because I was just about to go back to maven.

Jeff

@jlsheehan what version of java and what operating system are you on?

I got the same issue on my desktop:
OS X Yosemite (10.10)
Oracle Java 7 (1.7.0_71)

and build system:
Ubuntu 12.04 (Linux Kernel 3.2.0_76)
OpenJDK 7 (1.7.0_79)

Jeff

@jlsheehan thanks for reporting. This is indeed an issue introduced in 2.5.
Here’s the jira for it: https://issues.gradle.org/browse/GRADLE-3336

@Adrian_Kelly is there any reason this fix doesn’t get into Gradle 2.7 directly? It is still in release-candidate phase so it should be possible to add things to this release. Considering this is blocking deploying on these Gradle versions completely (I don’t know any workaround, is there one?) it should get fixed ASAP.

I have the same problem, but with webdav. In gradle 2.4 it works fine but with 2.5 or 2.7 it complains:

Caused by: org.sonatype.aether.transfer.NoRepositoryConnectorException: 
    No connector available to access repository remote (dav:https://xxxx/private/release/)
    of type default using the available factories WagonRepositoryConnectorFactory

GRADLE-3336 has been fixed in the master branch, and this fix will be in the upcoming 2.8 release of Gradle.

I ran into this same bug, and I couldn’t figure it out, until I saw that bug report. I then switched to 2.8rc1 and I can confirm, it works fine and easily connects over SSH. There is one quirk. If you use wagon-ssh, it does not like the known_hosts file format used by modern OpenSSH client. For me the easiest workaround was to use wagon-ssh-external and use scpexec as the schema.

Sorry,

I have the same problem and I want to update my gradle version to latest. Is there a way to upload the version via build.gradle or IntelliJ? I can’t find a response in the web.

Thanks

I resolved the problem installin Gradle 2.12 in my host and configurating the Gradle in IntelliJ. Thanks