Overwrite ivy cache with publish-local

1,529 views
Skip to first unread message

danie...@imagini.net

unread,
Apr 9, 2013, 5:07:24 PM4/9/13
to simple-b...@googlegroups.com
Hey all,

I've been having problems with the following:

Me and some of my colleagues are working on a shared library, at any time we may all be contributing to the same version of a snapshot, lets say project-x-version-y-SNAPSHOT. It seems that the default behaviour of publish-local (perhaps quite low down in ivy) is to not overwrite the ivy cache located at ~/.ivy2/cache/ (although it does still write to ~/.ivy2/local/) if there is an existing ivydata-version-y-SNAPSHOT.properties file there.

 The result of this is that if any of us want to use a local version of the library while developing (pretty common use case) then we need to go into ~/.ivy2/cache/ and manually delete any entries for project-x-version-y-SNAPSHOT, before then using publish-local. There is usually an entry there from downloading project-x from our maven repository. Is this the default behaviour? Or is my build messed up in some way? If not what would be the best way to  automate the "cleaning" of the cache? (we don't want to have to clean the whole thing, only project-x-version-y-SNAPSHOT).

Let me know if you want any more info (my build settings are pretty verbose, so sorry for not posting them, I don't think I've changed anything related to this).

Cheers!

danie...@imagini.net

unread,
Apr 9, 2013, 6:39:39 PM4/9/13
to simple-b...@googlegroups.com
Just to confirm that the first resolver is 

val resolversStuff = evalTask(externalResolvers in Compile,currentState)
warning
: there were 1 deprecation warnings; re-run with -deprecation for details
resolversStuff
: Seq[sbt.Resolver] = List(FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext])

and the ivy page for local repositories seems to suggest that this should work as I am expecting it to http://ant.apache.org/ivy/history/latest-milestone/tutorial/defaultconf.html (see the bit about local repositories).

Mark Harrah

unread,
Apr 12, 2013, 8:46:57 AM4/12/13
to simple-b...@googlegroups.com
What sbt version are you using and have you seen:

http://www.scala-sbt.org/release/docs/Detailed-Topics/Dependency-Management-Flow.html

-Mark

> Cheers!
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

danie...@imagini.net

unread,
Apr 19, 2013, 12:09:00 PM4/19/13
to simple-b...@googlegroups.com
Thanks Mark,

Sorry for the delay getting back to you.

I've seen the wiki page (which was very helpful), but it seems to suggest to me that I shouldn't be getting this behaviour. 

I'm using sbt 0.12.2

danie...@imagini.net

unread,
Apr 19, 2013, 12:09:19 PM4/19/13
to simple-b...@googlegroups.com
PS. Is there anything else I can provide to help debug the problem?

Mark Harrah

unread,
Apr 22, 2013, 10:26:57 AM4/22/13
to simple-b...@googlegroups.com
On Fri, 19 Apr 2013 09:09:00 -0700 (PDT)
danie...@imagini.net wrote:

> Thanks Mark,
>
> Sorry for the delay getting back to you.
>
> I've seen the wiki page (which was very helpful), but it seems to suggest
> to me that I shouldn't be getting this behaviour.
>
> I'm using sbt 0.12.2

Note that 'publish-local' isn't what would normally update the cache. Running 'update' from another project would. There was a fix in 0.12.3 that might be relevant[1], so you might try using 0.12.3.

-Mark

[1] https://github.com/sbt/sbt/issues/704
> > an email to simple-build-t...@googlegroups.com <javascript:>.
> > > To post to this group, send email to simple-b...@googlegroups.com<javascript:>.
Reply all
Reply to author
Forward
0 new messages