Merge pull request #248 from khvatov/khvatov-patch-1

Fix for #4157
This commit is contained in:
eugene yokota 2018-06-26 00:44:05 -04:00 committed by GitHub
commit 9c97be613f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -216,7 +216,22 @@ private[sbt] case class SbtChainResolver(
val firstHit = sortedRevisions.reverse.headOption
firstHit.map { hit =>
val (resolvedModule, resolver) = hit
Message.warn(s"Choosing $resolver for ${resolvedModule.getId}")
if (resolvedModule.getId.getRevision.contains("SNAPSHOT")) {
Message.warn(
"Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withLatestSnapshots(false)` options.")
val resolvers = sortedRevisions.map(_._2.getName)
sortedRevisions.foreach(h => {
val (module, resolver) = h
Message.info(
s"Out of ${sortedRevisions.size} candidates we found for ${module.getId} in ${resolvers
.mkString(" and ")}, we are choosing ${resolver}.")
})
} else {
Message.warn(s"Choosing $resolver for ${resolvedModule.getId}")
}
// Now that we know the real latest revision, let's force Ivy to use it
val resolvedDescriptor = resolvedModule.getDescriptor
val artifactOpt = findFirstArtifactRef(resolvedDescriptor, data, resolver)