Dependency resolution using ivy sftp not working anymore in 2.1


In Gradle 2.0 I’ve used the following: repositories {

ivy {

url “sftp://…someurl…”

credentials {

username ‘xxx’

password ‘yyy’


} } This worked fine in Gradle 2.0. Now, in Gradle 2.1 it’s not working anymore.

Failing with: Password authentication not supported or invalid credentials for SFTP server at xyz

Switching from and to 2.0/2.1 can reproduce the problem.


This is almost certainly related to the fix for Can you provide the debug logs for this failure?
Possibly authentication is working in Gradle 2.0 using a mechanism other than password? (In Gradle 2.1 we enforce to use password auth only).


I’m using password auth:

repositories {
    ivy {
        url "sftp://devaid.local:22/srv/ivyrepo/"
        credentials {
            username 'xxx'
            password 'yyy'

Attached is debug log file when executing: ./gradlew clean jar -debug

As said, works ok with Gradle 2.0 but not with 2.1.

Regards, Manfred

Hey Manfred,
Is there any chance you can get the sftp server logs for these connection attempts?
As Daz mentioned in earlier versions gradle supported other authentications, which were tried before using the password provided by the build script. So it’s possible the username/password combination in your build script never worked and the underlaying ssh library gradle is using (jsch) already succeded with public key authentication.
Also we limited the “MaxAuthTries” to 1 (default was 6 before) and you might be seeing a sideeffect of this.

We’re happy to support you in figuring out what’s going on here. If it would help you, I can come up with a custom gradle version that adds more configuration options and detailed logging to the sftp support so we can nail down the root cause of that issue.


Indeed I see a lot of those in the log on the sshd side:

2014-10-08T09:23:41.754054+02:00 devaid sshd[10618]: error: Received disconnect from 3: com.jcraft.jsch.JSchException: Auth fail [preauth]

Logging in via a normal sftp client (Transmit on OS X) works OK, so it must be something on the client side which doesn’t seem to work properly. The sshd is not setup for public key authentication, so that cannot be the case.


I’ve uploaded a modified gradle version from current master that can help us to diagnose the root cause of this issue. The modified gradle version is available at

with this customized version you can set the ssh properties “PreferredAuthentications” and “MaxAuthTries” via system property from the commandline.

So try running your gradle build with




to check whether it’s the change of the PreferredAuthentications to use “password” only or if it’s the change of MaxAuthTries=1 that is causing your problems.

cheers, René

Running with ‘–debug’ will also enable Jsch debug logging, which will likely give clues.


MaxAuthTries didn’t help. PreferredAuthentications did help.

Log here:


What does that mean? I’m pretty sure gssapi-with-mic and publickey doesn’t apply. Was Gradle 2.0 in my case using keyboard-interactive for login?