Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use maven repository as local ivy cache

Tags:

maven-2

ivy

Is there any possibility to use local Maven repository (~/.m2) as local Ivy cache (~/.ivy)? They have different layouts.

Sometimes I use Maven and sometimes I use SBT which uses Ivy underneath, so I have 2 copies of same libs in both Maven and Ivy. I would like to use same dir thus saving disk space and network.

Thanks.

like image 294
Yura Taras Avatar asked Jun 02 '11 14:06

Yura Taras


People also ask

How to clean Ivy cache?

Clearing the Ivy cache The Ivy cache can become corrupted, especially when using the http type in the repositories section of conf/dependencies. yml . If this happens, and dependency resolution does not work, you can clear the cache with the --clearcache option. This is equivalent to rm -r ~/.

Where is the local Maven cache?

The first place that Maven looks for artifacts is in the local repository, which is the local cache where Maven stores all of the artifacts it has downloaded or found elsewhere. The default location of the local repository is the . m2/repository/ directory under the user's home directory.

Where is ivy2 folder?

ivy2/local while the cache of downloaded dependencies/libraries is under ~/. ivy2/cache . Play now uses the default ivy cache and repository, in the . ivy2 folder in the users home directory.


1 Answers

To save network, just configure ivy to use local Maven repository

      <property name="local-maven2-dir" value="${user.home}/.m2/repository/" />       <filesystem name="local-maven-2" m2compatible="true">         <artifact            pattern="${local-maven2-dir}/[organisation]/[module]/[revision]/[module]-[revision].[ext]" />         <ivy            pattern="${local-maven2-dir}/[organisation]/[module]/[revision]/[module]-[revision].pom" />       </filesystem> 
like image 144
4 revs, 4 users 75% Avatar answered Oct 13 '22 09:10

4 revs, 4 users 75%