# Custom ivy resolver deprecation in gradle 2.x?

**URL:** <https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492>\
**Category:** Old Forum Archive\
**Created:** [October 24, 2013, 1:28am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492 "2013-10-24T01:28:00Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![lzprgmr](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lzprgmr/32/402_2.png) [@lzprgmr](https://discuss.gradle.org/u/lzprgmr)\
**Post date:** [October 24, 2013, 1:28am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/1 "2013-10-24T01:28:00Z")

</div>

Hi, All,

I’ve heard from this StackOverflow question ([gradle - Custom Ivy resolver documentation - Stack Overflow](http://stackoverflow.com/questions/18964166/custom-ivy-resolver-documentation)) about the deprecation of ivy custom resolver in gradle 2.x, as in the first comment of the question:

> Be aware that using custom Ivy resolvers will no longer be supported in 2.x.

But I can’t find any official documentation about this - could you please help clarify:

- Is custom ivy resolvers specifically means the _ivy_ methods provided in RepositoryHandler([RepositoryHandler - Gradle DSL Version 8.4](http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.RepositoryHandler.html#org.gradle.api.artifacts.dsl.RepositoryHandler:ivy(groovy.lang.Closure)) \* Would this feature be deprecated on gradle 2.0? \* If yes, what would be alternatives, if I need to resolve artifacts from a non-standard repository? we are still using ivy.xml for dependencies.

Thanks very much!

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 24, 2013, 3:33am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/2 "2013-10-24T03:33:00Z")

</div>

Custom Ivy resolvers have already been deprecated (I believe in 1.7 or 1.8; check the release notes), and will no longer be supported in 2.x. Ivy repositories will still be supported. An example for use of a custom Ivy resolver would be:

```gradle
repositories {
     add(new org.apache.ivy.plugins.resolver.URLResolver())
 }

```

If you don’t use this or a similar Ivy resolver class in your build script, no changes will be necessary.

---

<div class="post-metadata">

**Author:** ![lzprgmr](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lzprgmr/32/402_2.png) [@lzprgmr](https://discuss.gradle.org/u/lzprgmr)\
**Post date:** [October 24, 2013, 4:07am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/3 "2013-10-24T04:07:00Z")

</div>

Cool, thanks Peter, we are using something like:

```gradle
repositories {
    ivy {
        ivyPattern "/filesytem/repo/[organisation]/[module]-ivy-[revision].xml"
        artifactPattern "/filesystem/repo/[organisation]/[module]-[revision](-[classifier]).[ext]"
    }
}

```

Which should be a _ivy repository_, not _ivy resolver_, so I guess we are safe.

Thanks.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 24, 2013, 4:10am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/4 "2013-10-24T04:10:00Z")

</div>

Yes, that’s fine.

---

<div class="post-metadata">

**Author:** ![Simon\_Wiehe](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Simon\_Wiehe](https://discuss.gradle.org/u/Simon_Wiehe)\
**Post date:** [October 24, 2013, 7:56am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/5 "2013-10-24T07:56:00Z")

</div>

I have something like this just so I can switch off the consistency checking (some of our ivy.xml files do not properly maintain a version number), is there a suggested way to achieve this without using a custom resolver?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 24, 2013, 8:09am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/6 "2013-10-24T08:09:00Z")

</div>

I don’t think that’s currently supported. Can’t you fix the ivy.xmls?

---

<div class="post-metadata">

**Author:** ![Simon\_Wiehe](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Simon\_Wiehe](https://discuss.gradle.org/u/Simon_Wiehe)\
**Post date:** [October 24, 2013, 8:18am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/7 "2013-10-24T08:18:00Z")

</div>

Not really an option as we have hundreds of ivy.xml files that are impacted and we dont have the control over them. We would also need to fix all the historic versions. Obviously any that we publish through Gradle will be correct.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 24, 2013, 8:24am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/8 "2013-10-24T08:24:00Z")

</div>

You could set up a proxy (e.g. Artifactory) and write a script that fixes the ivys automatically (if you can’t push the fixes upstream). Anyway, please describe your requirement as a new post of type “idea”, so that we can track it.

---

<div class="post-metadata">

**Author:** ![Simon\_Wiehe](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Simon\_Wiehe](https://discuss.gradle.org/u/Simon_Wiehe)\
**Post date:** [October 24, 2013, 8:54am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/9 "2013-10-24T08:54:00Z")

</div>

I will raise a new post. Sadly I work in a large corporate environment where change is slow and ideas like setting up proxies are not viable options.

---

<div class="post-metadata">

**Author:** ![steveb](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@steveb](https://discuss.gradle.org/u/steveb)\
**Post date:** [October 24, 2013, 11:21am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/10 "2013-10-24T11:21:00Z")

</div>

We are using a custom ivy resolver to access ivy with perforce as a backend

```gradle
repositories {
    add(new com.orga.ivy.plugins.p4resolver.P4Resolver()) {...

```

(see [https://github.com/fdrueke/ivyp4](https://github.com/fdrueke/ivyp4)). Yes, we store everything in one repository (there’s no need to host maven or artifactory and a separate scm).

This has the benefit that sources and artifacts (3rd party libs) are severed from one instance, which is perforce. All dependencies are versioned and traceable via commit logs.

Does it mean that the proposed change will disable this ?

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [October 24, 2013, 12:07pm UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/11 "2013-10-24T12:07:00Z")

</div>

@steveb Yes, this is an example of a custom Ivy resolver, which is deprecated. Please raise a separate forum issue so that we can track this particular use case. One of the reasons we have done early deprecation of custom Ivy resolvers is so that we understand better how they are used in the wild.

---

<div class="post-metadata">

**Author:** ![steveb](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@steveb](https://discuss.gradle.org/u/steveb)\
**Post date:** [October 24, 2013, 12:36pm UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/12 "2013-10-24T12:36:00Z")

</div>

Ok, posted as [http://gsfn.us/t/4ayx8](http://gsfn.us/t/4ayx8)

---

<div class="post-metadata">

**Author:** ![Jens\_Borrmann](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jens_borrmann/32/1425_2.png) [@Jens\_Borrmann](https://discuss.gradle.org/u/Jens_Borrmann)\
**Post date:** [April 11, 2014, 5:57am UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/13 "2014-04-11T05:57:00Z")

</div>

We are currently setting local attribute to false for a FileSystemResolver referencing a network drive with very slow access rates. This allows caching for this repository.

Is there already a not deprecated way to achieve caching for file system based resolvers?

Best regards, Jens

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [April 14, 2014, 8:27pm UTC](https://discuss.gradle.org/t/custom-ivy-resolver-deprecation-in-gradle-2-x/7492/14 "2014-04-14T20:27:00Z")

</div>

I’m not aware of a non-deprecated way to achieve this. I’ve added a story to the design doc to cover this use case. [https://github.com/gradle/gradle/blob/master/design-docs/repository-transports.md#allow-caching-for-a-slow-file-backed-repository](https://github.com/gradle/gradle/blob/master/design-docs/repository-transports.md#allow-caching-for-a-slow-file-backed-repository)

If you’re interested in getting involved by contributing a solution, please raise this as a topic on the developer list.
