0

Module A uses module B. I compile module B which implies a new jar in ~/.ivy2/local/[group]/B/[version]/B-[version].jar. ~/.ivy2/cache is not updated.

My problem is that Module A is trying to find B in ~/.ivy2/cache (that's what IvyDE indicates).

How can I ensure the cache is updated once project B is compiled?

Regards

Martin Pernollet
  • 2,285
  • 1
  • 28
  • 39
  • The cache will be updated whenever an ivy "resolve" or "retrieve" is performed against the new version of project B. Normally the repository is located on another machine, which is the purpose behind the cache. – Mark O'Connor Apr 28 '12 at 23:30

1 Answers1

1

You may want to use the workspace resolver feature of IvyDe:

enter image description here

This will makes all eclipse projectes directly available, without the need to build/publish th artfifacts.

Note: The Screenshot ist for 2.2.0Beta, but the feature exists for the current version, too.

oers
  • 18,436
  • 13
  • 66
  • 75
  • +1 @oers this works in the sense that the ivy.xml dependency resolution error goes away (i.e. it recognizes the workspace-based dependency), but does not actually provide class files to the dependent project, which means nothing has changed ;-( – virtualeyes May 07 '12 at 14:30
  • @virtualeyes what do you mean? do you still get compile errors in eclipsse? is the other project set-up correctly (src folders etc). Did you try a project-clean?.. – oers May 07 '12 at 19:30
  • I have to reference parent dependencies manually in child project, not the end of the world, but a hassle. It's a Scala project; via SBT everything compiles fine, and can jar up parent-child project no problem. Looks like a gain on SBT's end is a loss in Eclipse/IvyDE (since parent dependency in ivy.xml is doing nothing, presumably due to the fact that parent project is not jar'd, but compiled "live" in eclipse like the child project) – virtualeyes May 07 '12 at 20:59
  • does this help: http://stackoverflow.com/a/10473870/644450? It says you should run deliver local, so that an ivy.xml is created for the project, which will be picked up by ivyde. – oers May 08 '12 at 04:38
  • yes, that's exactly what I have been doing, IvyDE, which works great for standalone projects; however, when you add in a workspace-based parent project, Ivy is unable to pull in any dependencies as it expects the parent project to be a repository (for jar, bundle, etc.) and not an Eclipse class file directory. That is my (perhaps mis)understanding at this point. Anyway, it would be a serious nice-to-have. Workaround for now is to manually select parent dependencies (handful needed for child project to compile) from "/.ivy2" cache – virtualeyes May 08 '12 at 06:35
  • @virtualeyes I have like 12 projects in the workspace which depend on each other as parent/child projects and everything works fine (also with dependencies). But maybe this has something to do with sbt, which I don't know anything about :) – oers May 08 '12 at 06:41
  • good to know it can work. Should note that setting parent project reference and adding parent to child project's build path does work in that parent projects classes are recognized in the child. The issue is the parent project's dependencies being recognized in the child, that's where I'm getting hosed ;-) – virtualeyes May 08 '12 at 06:46