diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt index 3665d3634..10453a7ed 100644 --- a/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-configurations/build.sbt @@ -1,22 +1,28 @@ -def myResolver = resolvers += Resolver.file("buggy", file("repo"))( - Patterns( - ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"), - artifactPatterns = Seq("[organization]/[module]/[revision]/[artifact]"), - isMavenCompatible = false, - descriptorOptional = true, - skipConsistencyCheck = true - ) -) +def commonSettings: Seq[Def.Setting[_]] = + Seq( + organization := "com.example", + ivyPaths := new IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")), + dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency", + resolvers += Resolver.file("buggy", (baseDirectory in LocalRootProject).value / "repo")( + Patterns( + ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"), + artifactPatterns = Seq("[organization]/[module]/[revision]/[artifact]"), + isMavenCompatible = false, + descriptorOptional = true, + skipConsistencyCheck = true + ) + ) + ) lazy val a = project settings( - myResolver, - updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile - libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime", - libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime2" + commonSettings, + updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile + libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime", + libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime2" ) lazy val b = project dependsOn(a) settings( - myResolver, - updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile - libraryDependencies += "a" % "b" % "1.0.1" % "compile->runtime" + commonSettings, + updateOptions := updateOptions.value.withCachedResolution(true), //comment this line to make ws compile + libraryDependencies += "a" % "b" % "1.0.1" % "compile->runtime" )