[GRADLE-2910] Uploading to an ivy repository via SSH has been deprecated in Gradle 1.8 Created: 02/Oct/13  Updated: 01/Apr/15  Resolved: 04/Jun/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.0-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 1


Upgrading to Gradle 1.8 gives following warning: "The ArtifactRepositoryContainer.add(DependencyResolver, Closure) method has been deprecated and is scheduled to be removed in Gradle 2.0." - don't know how to add Ivy SSH publisher (type org.apache.ivy.plugins.resolver.SshResolver) to repositories.

Currently I'm adding this SSH resolver to the repositories the artifact should get published to like so:

uploadArchives {
repositories {
add( new org.apache.ivy.plugins.resolver.SshResolver() ) {
name = 'publish-repository'
host = 'some.host'
user = 'some.user'
keyFile = someKeyFile
keyFilePassword = 'key.file.password'
checksums = 'sha1, md5'
addIvyPattern '~/ivy-repository/[organisation]/[module]/[revision]/ivy.xml'
addArtifactPattern '~/ivy-repository/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]'

Comment by Gradle Forums [ 02/Oct/13 ]

In Gradle 1.8, all direct use of Ivy DependencyResolver implementations [has been deprecated]([1]http://www.gradle.org/docs/current/re...). We've done this as part of our [early preparations for Gradle 2.0]([2]http://www.gradle.org/docs/current/re...).

Unfortunately, resolving and publishing via SSH is one use case that does not yet have a non-deprecated replacement. This is something we'll need to tackle in the lead up to Gradle 2.0.

(One reason for early deprecation is to discover what use cases currently require the use of a direct Ivy DependencyResolver, through user reports such as this. Thanks.)
[1] http://www.gradle.org/docs/current/release-notes#support-for-using-ivy-dependencyresolver-implementations
[2] http://www.gradle.org/docs/current/release-notes#early-preparations-for-gradle-2.0

Comment by andreas [ 19/May/14 ]

Our company is currently looking for switching from Ant to Gradle. Our repository setup for downloading and uploading are currently (version 1.11):

 add(new org.apache.ivy.plugins.resolver.SFTPResolver()) {

            name = 'ivy-shared-sftp'
            keyFile = new File(personalProperties.get("ivy.shared.repo.keyFile"))
            addIvyPattern      "sftp://ivy@server:22/ivy/ivy-repositories/shared/[organisation]/[module]/[revision]/ivy.xml"
            addArtifactPattern "sftp://ivy@server:22/ivy/ivy-repositories/shared/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"

Not having an equivalent in Gradle 2 will be a problem for us.

Comment by Adam Murdoch [ 04/Jun/14 ]

The 2.0 release includes support for accessing repositories using SFTP.

Comment by andreas [ 21/Jul/14 ]

Hello, thanks for the update.
I tried out gradle 2.0, and get a (expected") message that class is not available: org.apache.ivy.plugins.resolver.SFTPResolver()

What would be the gradle2 equivalent of my code snippet 2 posts up, ie fetch artifacts from SFTP with private key authN?

Comment by Ben Madsen [ 30/Jul/14 ]

@andreas - You can find information on the SFTP support here:


However, I believe it does not support any key-based authentication (at least from what I can tell from docs and diving into the source code).

Comment by Brian Putnam [ 01/Apr/15 ]

For future googlers: the link in the previous comment doesn't work anymore. Here's an updated link:

Generated at Wed Jun 30 12:34:45 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.