Use maven repository as local ivy cache
Asked Answered
B

2

29

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.

Balancer answered 2/6, 2011 at 14:54 Comment(0)
J
5

You can specify the cache and the layout of the cache by using the

  <cache/> Tag

.

I think you will have to alter the patterns for the artifacts/ivy.xml files.
The Tag is described here: http://ant.apache.org/ivy/history/2.0.0/settings/caches.html.
It seems that it should work, but I've never tried :).

Jovanjove answered 3/6, 2011 at 6:59 Comment(0)
R
24

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>
Retorsion answered 2/6, 2011 at 14:54 Comment(0)
J
5

You can specify the cache and the layout of the cache by using the

  <cache/> Tag

.

I think you will have to alter the patterns for the artifacts/ivy.xml files.
The Tag is described here: http://ant.apache.org/ivy/history/2.0.0/settings/caches.html.
It seems that it should work, but I've never tried :).

Jovanjove answered 3/6, 2011 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.