Skip to content

Instantly share code, notes, and snippets.

@mkows
Last active August 4, 2017 12:27
Show Gist options
  • Save mkows/5b7f4d46f1d5e185420d11fb20323ca4 to your computer and use it in GitHub Desktop.
Save mkows/5b7f4d46f1d5e185420d11fb20323ca4 to your computer and use it in GitHub Desktop.
sbt - resolvers are not propagated from dependency library
/*
Resolvers -- specified on child level are not effective / visible on / propagated to parent lib.
// related: https://stackoverflow.com/questions/10727079/how-do-transitive-resolvers-work-with-sbt#23158200
Example with https://github.com/etaty/rediscala that requires custom resolver for rediscala ver. 1.3
Don't forget to make sure that lib is not cached locally, e.g. rm -rf ~/.ivy2/cache/com.etaty.rediscala
*/
// # build.sbt - lib with rediscala (requiring custom resolver)
organization := "com.github.mkows"
name := "lib-with-rediscala"
version := "0.0.1-SNAPSHOT"
scalaVersion := "2.10.6"
// https://stackoverflow.com/questions/10727079/how-do-transitive-resolvers-work-with-sbt#23158200
// https://github.com/etaty/rediscala
resolvers += "rediscala" at "https://raw.github.com/etaty/rediscala-mvn/master/releases/"
libraryDependencies += "com.etaty.rediscala" %% "rediscala" % "1.3"
// with this, `resolvers += ...` is not needed
// libraryDependencies += "com.etaty.rediscala" %% "rediscala" % "1.3" from "https://raw.github.com/etaty/rediscala-mvn/master/releases/com/etaty/rediscala/rediscala_2.10/1.3/rediscala_2.10-1.3.jar"
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.4" % "test"
// # another build.sbt - parent using lib with rediscala
organization := "com.github.mkows"
name := "parent-using-lib-with-rediscala"
version := "0.0.1-SNAPSHOT"
scalaVersion := "2.10.6"
// NOTE: the below resolver must be specified, otherwise it won't be picked up from lib-with-rediscala
// resolvers += "rediscala" at "https://raw.github.com/etaty/rediscala-mvn/master/releases/"
libraryDependencies ++= Seq(
"com.github.mkows" %% "lib-with-rediscala" % "0.0.1-SNAPSHOT",
"org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment