From 22f47be292135a4d7118cd03732dca434b293bf2 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 25 Jul 2017 17:19:45 -0400 Subject: [PATCH] Change overwrite warning Previously the warning read: Attempting to overwrite $destination This usage is deprecated and will be removed in sbt 1.0. This is an empty threat since we did not remove the feature. I'm replacing it with: Attempting to overwrite $destination (non-SNAPSHOT) You need to remove it from the cache manually to take effect. Fixes sbt/sbt#3271 --- .../sbt/internal/librarymanagement/ConvertResolver.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala index f31d223d3..a90399b8b 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala @@ -400,10 +400,11 @@ private[sbt] object ConvertResolver { try super.put(source, destination, overwrite) catch { case e: java.io.IOException if e.getMessage.contains("destination already exists") => + val overwriteWarning = + if (destination contains "-SNAPSHOT") s"Attempting to overwrite $destination" + else "Attempting to overwrite $destination (non-SNAPSHOT)\n\tYou need to remove it from the cache manually to take effect." import org.apache.ivy.util.Message - Message.warn( - s"Attempting to overwrite $destination\n\tThis usage is deprecated and will be removed in sbt 1.0." - ) + Message.warn(overwriteWarning) super.put(source, destination, true) } }