Add ivyLocal repository configuration

In the dependency manager there is mavenLocal to add local repository, wouldn’t it be good to have an ivyLocal as well which sets up a repository configuration for a local ivy repository with default configurations.

It’s not hard to set it up manually, it could just be a more convenient way to do it.

What do you mean by “local ivy repository”. Do you mean the ivy cache? If so, do you have a need for this beyond reducing downloads?

The primary purpose behind ‘mavenLocal’ is to provide access to locally published modules. As far as I know, ivy does not allow local publication to the ivy cache.

There is absolutely no need to use ‘mavenLocal’ to reduce downloads, since Gradle will use existing artifacts from the m2 repository even if ‘mavenLocal’ is not declared. Details on how this works can be found at: http://gradle.org/docs/current/userguide/userguide_single.html#sec:dependency_cache (in particular, the section on ‘Artifact Reuse’).

So perhaps what you really want is Artifact Reuse from the local ivy cache?

Hi Daz It’s not the cache I’m after, gradle does the caching for me very well. It’s a local ivy repository, just like maven have.

This is how I do it today (from our release plugin) publishLocalTask.repositories.ivy {

url “file://${System.properties[‘user.home’]}/.ivy2/local”

layout ‘pattern’, {

artifact “[organisation]/[module]/[revision]/[type]s/[artifact].[ext]”

ivy “[organisation]/[module]/[revision]/[type]s/[artifact].[ext]”

} }

What we have is quite a lot of multi project builds and we need to publish some artifacts locally when building functionality that spreads over many projects.

It was just that I was looking in the api and found a mavenLocal but no ivyLocal.

We’ll probably address the issue of publish/consume locally in a different way. I’m not sure the ivy cache is the right place to do publication. The main reason we provide mavenLocal is for maven/Gradle integration.

But your use-case is definitely on our radar.

This use case also applies to the case where you have to mix sbt and gradle. I.e. have a library generated and published locally by sbt that you want to pull in as a snapshot dependency in gradle.

I’ve got a similar need; our company has a variety of projects, using different build tools, and “publishing” to the local Ivy cache is the least common denominator of preference for allowing the different build technologies to build JARs that other build technologies can reference.

Also, the statement that Ivy doesn’t allow publication to the local cache isn’t accurate; Ivy will happily serve up “cached” content that “magically appears” on the filesystem due to build system processes.