Repository: scala-steward-org/scala-steward
Pull request #1708 (2020-11-02 21:09:47)

Do not put sbt in offline mode
Some builds cannot be loaded in offline mode because of missing
dependencies. They then fail with errors like this:
```
sbt.librarymanagement.ResolveException: unresolved dependency: com.github.gseitz#sbt-release;1.0.13: not found
```

Using `offline` was added in #1253 in an attempt to reduce traffic with
Maven Central. But it turned out that the policy of our version cache was
responsible for most of the traffic (#1259) so I'm fine with removing
this again now.


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/SbtAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/SbtAlg.scala
index ffcd52ed..ce5386ce 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/SbtAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/SbtAlg.scala
@@ -79,8 +79,7 @@ object SbtAlg {
       override def getDependencies(repo: Repo): F[List[Scope.Dependencies]] =
         for {
           repoDir <- workspaceAlg.repoDir(repo)
-          commands =
-            Nel.of(setOffline, crossStewardDependencies, reloadPlugins, stewardDependencies)
+          commands = Nel.of(crossStewardDependencies, reloadPlugins, stewardDependencies)
           lines <- sbt(commands, repoDir)
           dependencies = parser.parseDependencies(lines)
           additionalDependencies <- getAdditionalDependencies(repo)
diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/command.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/command.scala
index aff81156..077f27db 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/command.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/command.scala
@@ -17,7 +17,6 @@
 package org.scalasteward.core.buildtool.sbt
 
 object command {
-  val setOffline = "set offline := true"
   val stewardDependencies = "stewardDependencies"
   val crossStewardDependencies = s"+ $stewardDependencies"
   val reloadPlugins = "reload plugins"
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index c7b4e387..42d0faa4 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -17,7 +17,7 @@ object Dependencies {
   val circeParser = "io.circe" %% "circe-parser" % circeGeneric.revision
   val circeRefined = "io.circe" %% "circe-refined" % circeGeneric.revision
   val commonsIo = "commons-io" % "commons-io" % "2.8.0"
-  val coursierCore = "io.get-coursier" %% "coursier" % "2.0.6"
+  val coursierCore = "io.get-coursier" %% "coursier" % "2.0.5"
   val coursierCatsInterop = "io.get-coursier" %% "coursier-cats-interop" % coursierCore.revision
   val cron4sCore = "com.github.alonsodomin.cron4s" %% "cron4s-core" % "0.6.1"
   val disciplineScalatest = ("org.typelevel" %% "discipline-scalatest" % "2.0.1")
diff --git a/project/build.properties b/project/build.properties
index c19c768d..08e4d793 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1,1 +1,1 @@
-sbt.version=1.4.2
+sbt.version=1.4.1


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/BuildToolDispatcherTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/BuildToolDispatcherTest.scala
index 1137077c..5d5f6da1 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/BuildToolDispatcherTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/BuildToolDispatcherTest.scala
@@ -33,7 +33,7 @@ class BuildToolDispatcherTest extends AnyFunSuite with Matchers {
           "--env=VAR1=val1",
           "--env=VAR2=val2",
           "sbt",
-          s";$setOffline;$crossStewardDependencies;$reloadPlugins;$stewardDependencies"
+          s";$crossStewardDependencies;$reloadPlugins;$stewardDependencies"
         ),
         List("read", s"$repoDir/project/build.properties"),
         List("read", s"$repoDir/.scalafmt.conf")
diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/sbt/SbtAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/sbt/SbtAlgTest.scala
index 0726f297..e4f7290e 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/sbt/SbtAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/sbt/SbtAlgTest.scala
@@ -45,7 +45,7 @@ class SbtAlgTest extends AnyFunSuite with Matchers {
           "--env=VAR1=val1",
           "--env=VAR2=val2",
           "sbt",
-          s";$setOffline;$crossStewardDependencies;$reloadPlugins;$stewardDependencies"
+          s";$crossStewardDependencies;$reloadPlugins;$stewardDependencies"
         ),
         List("read", s"$repoDir/project/build.properties")
       )