Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1227

UseCacheOnly doesn't respect the cache configuration in the ivysettings

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.0-RC1
    • 2.3.0-RC1
    • Core
    • None

    Description

      In my ivysettings.xml I have configured some cache which avoid having the resolver use the common .ivy2 cache. If on the resolve task I set useCacheOnly="true", then my artifacts in the cache won't be found.
      I'll attach a complete test case for the different scenario:

      1. defaultResolver="ibiblio", useCacheOnly="false", dependency on common-logging-1.1: nominal behaviour, everything works fine, artifacts get downloaded into .ivy2
      2. defaultResolver="ibiblio", useCacheOnly="true", dependency on common-logging-1.1: there is a bug in the CacheResolver, artifacts are not "downloaded", they not found. It was a missing ensuredConfigured(). I'll commit that as I am quite confident in that fix. With the fix, everything goes well.
      3. defaultResolver="chain", useCacheOnly="false", dependency on common-logging-1.2: it should be not be found in the ibiblio resolver but in the local one. Everything works fine, it get cached correctly from the local repo.
      4. defaultResolver="chain", useCacheOnly="true", dependency on common-logging-1.2: it is not found. As I was debugging it, in fact the CacheResolver isn't configured with the proper cache manager, so it uses the default one. So it looks in the wrong cache.

      My proposal as the last fix is to not use the cache resolver as a dictator resolver when we want useCacheOnly. I don't see any obvious way to make cache resolver aware of the cache it should look into, further more when there is chaining. I suggest to move this logic in the configured resolvers. I tried a very simple patch and it seems to work nicely. See the attached patch. I am not confident enough to commit it without review as it might be quite incomplete or have some side effect. At least it works with some chaining and even if there is some useOrigin=true

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hibou Nicolas Lalevée
            hibou Nicolas Lalevée
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment