From e6c846db47444f59e837866cd5ef6277e144338b Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Mon, 14 Dec 2015 16:59:55 -0500 Subject: [PATCH] Fixes #1514. Enable latest SNAPSHOT option by default #1520 originally fixed #1514 by reimplementing part of chain resolver to check all resolvers to find the latest snapshot artifacts. This behavior did not work well with Maven repositories where sbt was failing to calculate the correct publication dates. Now that #2075 fixes the Maven integration issue we should enable this flag back again. The build user can opt out by: updateOptions := updateOptions.value.withLatestSnapshots(false) --- ivy/src/main/scala/sbt/UpdateOptions.scala | 2 +- notes/0.13.10/fix-snapshots.md | 12 ++++++++++++ .../snapshot-resolution/build.sbt | 8 ++++---- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 notes/0.13.10/fix-snapshots.md diff --git a/ivy/src/main/scala/sbt/UpdateOptions.scala b/ivy/src/main/scala/sbt/UpdateOptions.scala index 3a710026c..3f640867d 100644 --- a/ivy/src/main/scala/sbt/UpdateOptions.scala +++ b/ivy/src/main/scala/sbt/UpdateOptions.scala @@ -75,7 +75,7 @@ object UpdateOptions { def apply(): UpdateOptions = new UpdateOptions( circularDependencyLevel = CircularDependencyLevel.Warn, - latestSnapshots = false, + latestSnapshots = true, consolidatedResolution = false, cachedResolution = false, resolverConverter = PartialFunction.empty) diff --git a/notes/0.13.10/fix-snapshots.md b/notes/0.13.10/fix-snapshots.md new file mode 100644 index 000000000..597347526 --- /dev/null +++ b/notes/0.13.10/fix-snapshots.md @@ -0,0 +1,12 @@ + + [@eed3si9n]: https://github.com/eed3si9n + [1514]: https://github.com/sbt/sbt/issues/1514 + +### Fixes with compatibility implications + +### Improvements + +### Bug fixes + +- Turns update option's `withLatestSnapshots` flag `true` by default. + [#1514][1514] by [@eed3si9n][@eed3si9n] diff --git a/sbt/src/sbt-test/dependency-management/snapshot-resolution/build.sbt b/sbt/src/sbt-test/dependency-management/snapshot-resolution/build.sbt index 0b9106118..4eac19855 100644 --- a/sbt/src/sbt-test/dependency-management/snapshot-resolution/build.sbt +++ b/sbt/src/sbt-test/dependency-management/snapshot-resolution/build.sbt @@ -25,8 +25,8 @@ lazy val common = project. case _ => false // TODO - Handle chain repository? } case _ => true - }), - updateOptions := updateOptions.value.withLatestSnapshots(true) + }) + // updateOptions := updateOptions.value.withLatestSnapshots(true) ) lazy val dependent = project. @@ -37,9 +37,9 @@ lazy val dependent = project. // Ignore the inter-project resolver, so we force to look remotely. resolvers += sharedResolver, fullResolvers := fullResolvers.value.filterNot(_==projectResolver.value), - libraryDependencies += "com.badexample" % "badexample" % "1.0-SNAPSHOT", + libraryDependencies += "com.badexample" % "badexample" % "1.0-SNAPSHOT" // Setting this to false fails the test - updateOptions := updateOptions.value.withLatestSnapshots(true) + // updateOptions := updateOptions.value.withLatestSnapshots(true) ) TaskKey[Unit]("dumpResolvers") := {