rtimush / sbt-updates

sbt plugin that can check Maven and Ivy repositories for dependency updates
BSD 3-Clause "New" or "Revised" License
761 stars 55 forks source link

sbt-updates stopped working for me #211

Closed bwbecker closed 3 years ago

bwbecker commented 3 years ago

sbt-updates stopped working for me. I know that's not helpful, but if there are any suggestions for how to debug, I'd welcome them.

I've used it on this project in the past and it's been very helpful. Today, however, it just gives

oat] $ dependencyUpdates
[info] Found 1 dependency update for oat
[info]   org.scala-lang:scala-library : 2.12.13 -> 2.13.5
[info] Found 2 dependency updates for wsvc
[info]   com.github.spullara.mustache.java:scala-extensions-2.11 : 0.9.6   -> 0.9.7          
[info]   org.scala-lang:scala-library                            : 2.12.13          -> 2.13.5
[info] Found 1 dependency update for wapp
[info]   org.scala-lang:scala-library : 2.12.13 -> 2.13.5
[success] Total time: 1 s, completed Mar. 2, 2021, 3:20:18 p.m.

when I know there are other dependencies that require updating.

In addition, the output has no mention of subprojects involving Scala.js (which have dependencies that need updating).

rtimush commented 3 years ago

I'd suggest running sbt -debug dependencyUpdates. The plugin will list all URLs it tries to access looking for dependency updates, so you may check if they make sense. Another possible cause is #67, if you have crossScalaVersions defined.

bwbecker commented 3 years ago

Thanks for the suggestion. The list of URLs it checks is pretty short:

[debug] Downloading https://jcenter.bintray.com/ca/uwaterloo/playformsst_2.12/maven-metadata.xml anonymously
[debug] Downloading https://repo1.maven.org/maven2/com/github/spullara/mustache/java/scala-extensions-2.11/maven-metadata.xml anonymously
[debug] Downloading https://jcenter.bintray.com/com/github/spullara/mustache/java/scala-extensions-2.11/maven-metadata.xml anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/com/github/spullara/mustache/java/scala-extensions-2.11/maven-metadata.xml anonymously
[debug] Downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/maven-metadata.xml anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/org/scala-lang/scala-library/maven-metadata.xml anonymously
[debug] Downloading https://jcenter.bintray.com/org/scala-lang/scala-library/maven-metadata.xml anonymously
[debug] Downloading https://repo1.maven.org/maven2/ca/uwaterloo/playformsst_2.12/maven-metadata.xml anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/ca/uwaterloo/playformsst_2.12/maven-metadata.xml anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/org/scala-lang/scala-library/ anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/com/github/spullara/mustache/java/scala-extensions-2.11/ anonymously
[debug] Downloading https://repo1.maven.org/maven2/ca/uwaterloo/playformsst_2.12/ anonymously
[debug] Downloading https://cs.uwaterloo.ca/~cs-oat/maven/ca/uwaterloo/playformsst_2.12/ anonymously
[debug] Downloading https://jcenter.bintray.com/ca/uwaterloo/playformsst_2.12/ anonymously

That doesn't come close to the entire list that it should be checking. The cs.uwaterloo.ca URLs are for my own repo.

I'm not cross-compiling, so I don't think #67 is relevant. I'm targeting only Scala 2.12.13.

The structure of the project is:

xplatform{JS,JVM}               // my most basic stuff
     browser                           // ScalaJS stuff that depends on xplatformJS
     server                             // common JVM stuff that depends on xplatformJVM
          wapp                         // part of the server api; depends on server (and indirectly xplafform)
          wsvc                          // another part of the server api; also depends on server

This is all gathered together in the oat project that aggregates wapp and wsvc and depends on both of those as well.

I was surprised tonight that show libraryDependencies did not include the libraries specified by the depended-on projects. In the oat (top-level) project it showed libraries from wapp and wsvc but not server and lower (where most of the libraries are specified. server did not show anything from xplatform.

bwbecker commented 3 years ago

My memory was that a single application of dependencyUpdates at the top-level project was all that was required. Apparently my memory is bad or that behaviour has changed. In any case, applying dependencyUpdates in each of the subprojects did what I needed.

Thanks for your help.

rtimush commented 3 years ago

Good to hear that you found a solution! dependencyUpdates follows the regular sbt project aggregation rules. Usually, the root sbt project aggregates all children, so it's enough to just call dependencyUpdates, but if there are non-aggregated subprojects you indeed need to run <subproject>/dependencyUpdates explicitly.