Closed mhogerheijde closed 5 years ago
Edited: corrected the expected output with the actual expected output instead of the copy-paste mistake I made
@mhogerheijde, thank you for such a thorough bug report! I hope #125 has fixed the problem. Would be great if you could check whether it works for you:
resolvers += Resolver.bintrayIvyRepo("rtimush", "sbt-plugin-snapshots")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.3-9-e0fa3dc")
@rtimush It works in the sense that I now do get the updates listed.
It does, however, now also throw RuntimeExceptions
for the missing sbtCredentials.ini
. (see output below).
I'm not fully sure if this is caused by the sbt-updates
plugin itself, since the throw ultimately occurs in the sbt.librarymanagement.ivy
package.
It might also be that I should test for the existence of the file before configuring it, but I'd rather not have too many if-statements in my build.
My build.sbt
has 4 projects, so I assume the errors are multiplied by the number of projects since it tries to find the sbtCredentials.ini
for every single project.
➜ sbt dependencyUpdates
[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt,metals.sbt ...
[info] Loading global plugins from /home/mhogerheijde/.sbt/1.0/plugins
[info] Loading settings for project husky-convert-build from plugins.sbt ...
[info] Loading project definition from /home/mhogerheijde/workspace-husky/husky-convert/project
[info] Updating ProjectRef(uri("file:/home/mhogerheijde/workspace-husky/husky-convert/project/"), "husky-convert-build")...
[info] downloading https://dl.bintray.com/rtimush/sbt-plugin-snapshots/com.timushev.sbt/sbt-updates/scala_2.12/sbt_1.0/0.4.3-9-e0fa3dc/jars/sbt-updates.jar ...
[info] [SUCCESSFUL ] com.timushev.sbt#sbt-updates;0.4.3-9-e0fa3dc!sbt-updates.jar (186ms)
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project husky-convert from build.sbt ...
[info] Set current project to husky-convert (in build file:/home/mhogerheijde/workspace-husky/husky-convert/)
[warn] Credentials file /var/jenkins_home/sbtCredentials.ini does not exist
[warn] Credentials file /var/jenkins_home/sbtCredentials.ini does not exist
[warn] Credentials file /var/jenkins_home/sbtCredentials.ini does not exist
[~100 x a variation of the following stacktrace]
[error] java.lang.RuntimeException: Credentials file /var/jenkins_home/sbtCredentials.ini does not exist
[error] at scala.sys.package$.error(package.scala:26)
[error] at sbt.librarymanagement.ivy.Credentials$.toDirect(Credentials.scala:36)
[error] at sbt.librarymanagement.ivy.Credentials$.$anonfun$allDirect$1(Credentials.scala:31)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
[error] at scala.collection.immutable.List.foreach(List.scala:388)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:233)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
[error] at scala.collection.immutable.List.map(List.scala:294)
[error] at sbt.librarymanagement.ivy.Credentials$.allDirect(Credentials.scala:31)
[error] at sbt.librarymanagement.ivy.Credentials$.forHost(Credentials.scala:30)
[error] at com.timushev.sbt.updates.Downloader.$anonfun$startDownload$1(Downloader.scala:12)
[error] at scala.util.control.Exception$Catch.$anonfun$either$1(Exception.scala:248)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error] at scala.util.control.Exception$Catch.either(Exception.scala:248)
[error] at com.timushev.sbt.updates.Downloader.startDownload(Downloader.scala:12)
[error] at com.timushev.sbt.updates.metadata.MavenMetadataLoader.$anonfun$download$1(MavenMetadataLoader.scala:48)
[error] at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)
[error] at scala.util.Success.$anonfun$map$1(Try.scala:251)
[error] at scala.util.Success.map(Try.scala:209)
[error] at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
[error] at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
[error] at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
[error] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
[error] at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[error] at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[error] at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[error] at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[error] at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[error] at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[info] Found 2 dependency updates for random
[info] org.scala-lang:scala-library : 2.12.8 -> 2.12.10 -> 2.13.1
[info] org.scalacheck:scalacheck : 1.14.1 -> 1.14.2
[info] Found 1 dependency update for husky-convert
[info] org.scala-lang:scala-library : 2.12.8 -> 2.12.10 -> 2.13.1
[info] Found 1 dependency update for cli
[info] org.scala-lang:scala-library : 2.12.8 -> 2.12.10 -> 2.13.1
[info] Found 1 dependency update for converterextra
[info] org.scala-lang:scala-library : 2.12.8 -> 2.12.10 -> 2.13.1
[info] Found 2 dependency updates for converter
[info] net.sf.saxon:Saxon-HE : 9.9.1-3 -> 9.9.1-5
[info] org.scala-lang:scala-library : 2.12.8 -> 2.12.10 -> 2.13.1
[success] Total time: 1 s, completed Sep 30, 2019, 9:30:21 AM
sbt dependencyUpdates 96.96s user 5.22s system 597% cpu 17.094 total
Can you please try 0.4.3-10-409c548
?
Works like a charm! Thanks!
Our internal nexus repository needs credentials to publish artefacts, but none to download them.
We do this by having a
sbtCredentials.ini
on our build server and ourbuild.sbt
containsThis file is not present on our development machines.
When running
sbt dependencyUpdates
on our local machines, it reports "no updates found". When I remove the line, it does find updates.build.sbt (cut down to the bare minimum to show the issue):
project/plugins.sbt:
When I run
sbt dependencyUpdates
:When I remove the line with the credentials set up, the expected output is:
Note that when I set up the configuration for actually pushing to our internal repo, I also get
But I'm not publishing to the repository and sbt can actually read (and compile etc.) when I add our private packages as dependencies.