Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:41:20+00:00 2026-05-15T21:41:20+00:00

In my Gradle script (version 0.8), I have a local ivy repository which I

  • 0

In my Gradle script (version 0.8), I have a local ivy repository which I use to publish a library, and I can’t seem to get Gradle to ignore its cache.

I’m accessing the local ivy repo. based on the recommendation in the Gradle manual. Here’s there relevant code (with some variables renamed).

dependencies{
  // [several remote dependencies]
  // ... 

  compile('myorg:mylib:0.1.0')
}

def ivy_repo = new org.apache.ivy.plugins.resolver.FileSystemResolver()
ivy_repo.name = 'ivy-repo'
ivy_repo.addIvyPattern local_repository + '/ivy/[organisation]/'+
   '[module]-ivy-[revision].xml'
ivy_repo.addArtifactPattern local_repository + '/ivy/[organisation]/'+
   '[module]-[revision](-[classifier]).[ext]'
ivy_repo.descriptor = 'optional'
ivy_repo.checkmodified = true

repositories{
  // [several remote repositories]
  // ...

  add(ivy_repo)
}

My problem is that when I run my script, once the local libraries are resolved, subsequent calls to the build script make use of the ~/.gradle/cache/myorg:mylib/, rather than the location of my local ivy repository. The Gradle manual has only a few lines mentioning that default local repositories should not use the cache, but I have found now way to actually indiciate that my repository is ‘default’ and local and thus shouldn’t use the cache.

I’ve tried setting ivy_repo.local = true, or using compile(‘myorg:mylib:0.1.0’){changing = true}, but neither seems to work.

I don’t want to use a flatDir repository because the local library has dependencies which I want my project to find (and I’m using the ivy file associated with the local library to do that now, and it appears that a flatDir repository ignores these sort of files… or maybe I was doing something wrong there?)

Anyone know a solution? Or maybe a better way to accomplish my task with Gradle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:41:20+00:00Added an answer on May 15, 2026 at 9:41 pm

    Any ivy resolver has a Resolver.setRepositoryCacheManager() method. It takes a RepositoryCacheManager as an argument. You can create you own specially configured instance of DefaultRepositoryCacheManager and pass it to the method. With useOrigin you indicate that the cache shouldn’t be used for artifacts.


    DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
    cacheManager.setName(name);
    cacheManager.setUseOrigin(true);
    cacheManager.setLockStrategy(new NoLockStrategy());
    cacheManager.setIvyPattern(ResolverContainer.DEFAULT_CACHE_IVY_PATTERN);

    We want to make this more convenient in 1.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we use Gradle for building Java projects and at the moment we have Ivy
I have a JS script (widget) which is added to other websites. Technically its
I have a project using Gradle as the build tool and I have to
I am doing a gradle/OSGi build. I have the OSGi bundle building fine, but
Let's say I have a database column 'grade' like this: |grade| | 1| |
I am trying to get started writing scalable, telecom-grade applications with Asterisk and Ruby.
I have a number of interdependent projects in an Eclipse workspace. Eclipse manages dependencies
Is there any jquery plugin/script to detect Adobe Reader on user system ? and
I need to pre-load some values from a php script, I'm using a $.post
I never really put too much time on optimizing website. Sure i put script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.