SBT + local maven repo

1,264 views
Skip to first unread message

Piotr Gabryanczyk

unread,
May 29, 2012, 6:25:31 PM5/29/12
to simple-b...@googlegroups.com
I am migrating from maven to sbt, so some of my projects are on sbt and some on maven.
When I locally publish artifacts with maven (mvn clean install) I want these artifacts to be available immediately in sbt projects.

It doesn't seem to be the case. 

I've added a local maven resolver ( "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository") and it helped only the first time - sbt was able to find the artifact. When I changed the artifact and published it again (mvn clean install), sbt did not pick up the changes.

So, I suspect that sbt is caching it in local ivy repository and next time I do "sbt update" it looks first in ivy local cache and when it's there it doesn't check the local maven repo.

Is there any way of changing this precedence?

Josh Suereth

unread,
May 30, 2012, 11:41:01 AM5/30/12
to simple-b...@googlegroups.com
Are you using SNAPSHOT publishing?  My guess is that's probably the issue...

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/Zd4Ifzem-4wJ.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.

eugene yokota

unread,
May 30, 2012, 2:08:52 PM5/30/12
to simple-b...@googlegroups.com
sbt/ivy will cache your artifact unless it's a "changing" artifact. By default sbt configures artifacts with version ending in "-SNAPSHOT" to be a changing one,
but you can manually set it yourself as follows:

libraryDependencies ++= Seq(
  "com.example" %% "foo" % "0.1.3" changing()
)

-eugene
Reply all
Reply to author
Forward
0 new messages