Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt retrieveManaged doesn't pick up jars produced using publish-local

Tags:

scala

sbt

Suppose I have a project in which I've used sbt publish-local to generate local copies of the jar files in ~/.ivy2/local.

Another sbt project on the same machine can successfully locate these jars to satisfy dependencies. However, if in that project I use the option retrieveManaged := true, sbt never copies the jars out of ~/.iv2/local into the lib_managed directory.

How can I make this happen? (Is this behaviour intended?)

(I'm using sbt 0.12.1.)

like image 480
Scott Morrison Avatar asked Dec 14 '25 20:12

Scott Morrison


1 Answers

I am using the same setup. When I update my locally published dependencies, I remove the managed jars first and then run the update:

$ rm -r lib_managed/jars/my-package-prefix
$ sbt test:compile

(test:compile will figure out that the jars are missing and do the update by itself).

In older versions of sbt I believe there was an issue when using -SNAPSHOT versions, but I haven't seen this problem anymore with sbt 0.12.

In rare situations, something messes up with the Ivy cache and somehow you cannot enforce the updates. This is perhaps the case when corrupt Ivy meta data files have been used. Then the only solution is to wipe all occurrences of your dependency from ~/.ivy2/local and ~/.ivy2/cache, re-publish, and re-update.

like image 99
0__ Avatar answered Dec 18 '25 02:12

0__



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!