From ca43fb32d5944a340ed5b0db2a86125ae1607528 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 2 Aug 2019 15:12:26 -0400 Subject: [PATCH] fix the warning --- .../src/main/scala/xsbt/boot/Update.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/launcher-implementation/src/main/scala/xsbt/boot/Update.scala b/launcher-implementation/src/main/scala/xsbt/boot/Update.scala index 614da5c..560fee1 100644 --- a/launcher-implementation/src/main/scala/xsbt/boot/Update.scala +++ b/launcher-implementation/src/main/scala/xsbt/boot/Update.scala @@ -367,13 +367,17 @@ final class Update(config: UpdateConfiguration) { private def useSecureResolvers = sys.props.get("sbt.repository.secure") map { _.toLowerCase == "true" } getOrElse true private def centralRepositoryRoot(secure: Boolean) = { val value = (if (secure) "https" else "http") + "://repo1.maven.org/maven2/" - log(s"[warn] insecure HTTP request is deprecated '$value' via 'sbt.repository.secure'; switch to HTTPS") - log(s"[warn] Maven Central HTTP access is scheduled to end in January 2020") + if (!secure) { + log(s"[warn] insecure HTTP request is deprecated '$value' via 'sbt.repository.secure'; switch to HTTPS") + log(s"[warn] Maven Central HTTP access is scheduled to end in January 2020") + } value } private def jcenterRepositoryRoot(secure: Boolean) = { val value = (if (secure) "https" else "http") + "://jcenter.bintray.com/" - log(s"[warn] insecure HTTP request is deprecated '$value' via 'sbt.repository.secure'; switch to HTTPS") + if (!secure) { + log(s"[warn] insecure HTTP request is deprecated '$value' via 'sbt.repository.secure'; switch to HTTPS") + } value }