aiyanbo/sbt-dependency-updates

`dependencyUpdates` does not seem to use additional resolvers

jmvandebron opened this issue · 9 comments

We have a couple of internally published libraries, that are available via an S3 bucket. For this we are creating a Resolver in our build.sbt and adding it to our build. We use addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.21.0") to interact with S3:

// ./project/S3ArtefactRepo.scala
object S3ArtefactRepo {
  lazy val s3Mirror = "S3 Mirror" at s"s3://s3.amazonaws.com/[our-bucket-name]/maven"
}

...
// ./build.sbt
// make sure the build can resolve our internally published libraries
ThisBuild / resolvers += S3ArtefactRepo.s3Mirror

This setup works for our sbt commands (like compile, test, release), but when we run dependencyUpdates, all our dependencies to the internal libraries are reported as not found:

                                                service
[info] ---------------------------------- Global Plugins ----------------------------------
[success   ] com.github.sbt:sbt-git:2.0.1 √
[info] ----------------------------------- Dependencies -----------------------------------
[success   ] org.scala-lang:scala-library:2.13.11 √
[not_found ] <redacted>:<redacted>:0.4.5 ×
[not_found ] <redacted>:<redacted>:0.4.5 ×
[success] Total time: 1 s, completed 28 Jun 2023, 12:29:41

It looks like the S3 repo is not being queried. What can we do to make dependencyUpdates interrogate the S3 bucket too?

@jmvandebron Can you help me test this version 1.2.8-SNAPSHOT? I don't have an aws repository at the moment.

addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.8-SNAPSHOT")

How do I do that? I tried adding this to the ./project/plugins.sbt

resolvers += Resolver.sbtPluginRepo("snapshots")

addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.8-SNAPSHOT")

But then sbt fails to load:

$ sbt
[info] welcome to sbt 1.8.2 (Amazon.com Inc. Java 17.0.6)
[info] loading settings for project global-plugins from myPlugins.sbt ...
[info] loading global plugins from /Users/jml/.sbt/1.0/plugins
[info] loading settings for project vdb-sbt-work-build-build from plugins.sbt ...
[info] loading project definition from /Users/jml/work/vandebron/repos/vdb-sbt-work/project/project
[info] loading settings for project vdb-sbt-work-build from plugins.sbt,sbtDependencies.sbt ...
[info] loading project definition from /Users/jml/work/vandebron/repos/vdb-sbt-work/project
[info] Installing the s3:// URLStreamHandler via java.net.URL.setURLStreamHandlerFactory
Downloading https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/sbt-dependency-updates-1.2.8-SNAPSHOT.pom
Downloaded https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/sbt-dependency-updates-1.2.8-SNAPSHOT.pom
Downloading https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/sbt-dependency-updates-1.2.8-SNAPSHOT.pom.sha1
Downloaded https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/sbt-dependency-updates-1.2.8-SNAPSHOT.pom.sha1
Downloading https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/maven-metadata.xml
Downloaded https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/maven-metadata.xml
Downloading https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/maven-metadata.xml.sha1
Downloaded https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/maven-metadata.xml.sha1
Downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloaded https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
Downloaded https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
Downloading https://repo.typesafe.com/typesafe/ivy-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloaded https://repo.typesafe.com/typesafe/ivy-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloading https://repo.typesafe.com/typesafe/ivy-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
Downloaded https://repo.typesafe.com/typesafe/ivy-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
Downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloaded https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
Downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
Downloaded https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml.sha1
[warn]
[warn] 	Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn] 		org.jmotor.sbt:sbt-dependency-updates:1.2.8-SNAPSHOT (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn] 	Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.jmotor.sbt:sbt-dependency-updates;sbtVersion=1.0;scalaVersion=2.12:1.2.8-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/org/jmotor/sbt/sbt-dependency-updates_2.12_1.0/1.2.8-SNAPSHOT/sbt-dependency-updates-1.2.8-SNAPSHOT.pom
[error]   not found: /Users/jml/.ivy2/local/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xm
[error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/org.jmotor.sbt/sbt-dependency-updates/scala_2.12/sbt_1.0/1.2.8-SNAPSHOT/ivys/ivy.xml

@jmvandebron

  • Add OSS snapshot repository to build.sbt
resolvers += Resolver.sonatypeRepo("snapshots")
  • Or, you can build the plugin from source in your local
git clone https://github.com/aiyanbo/sbt-dependency-updates.git

cd sbt-dependency-updates

sbt publishLocal

Thanks, I'll try that. Building locally produced a 1.2.7 version from master branch. I have updated the plugins.sbt to

resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.8-SNAPSHOT")

Which fixed the download. Will now proceed with testing.

The snapshot version shows the same results:

                                                  root
[info] ---------------------------------- Global Plugins ----------------------------------
[success   ] com.github.sbt:sbt-git:2.0.1 √
[info] -------------------------------------  Plugins -------------------------------------
[success   ] com.github.sbt:sbt-release:1.1.0 √
[unreleased] org.jmotor.sbt:sbt-dependency-updates:1.2.8-SNAPSHOT ---> 1.2.7
[info] ----------------------------------- Dependencies -----------------------------------
[success   ] org.scala-lang:scala-library:2.13.11 √
[success] Total time: 2 s, completed 30 Jun 2023, 10:10:16
sbt:root> service/dependencyUpdates
                                                service
[info] ---------------------------------- Global Plugins ----------------------------------
[success   ] com.github.sbt:sbt-git:2.0.1 √
[info] ----------------------------------- Dependencies -----------------------------------
[success   ] org.scala-lang:scala-library:2.13.11 √
[not_found ] <redacted>:<redacted>:0.4.6 ×
[not_found ] <redacted>:<redacted>:0.4.6 ×
[success] Total time: 0 s, completed 30 Jun 2023, 10:10:26

hey @aiyanbo, thanks for really cool plugin!

I tested 1.2.8-SNAPSHOT in a project that relies on a couple of resolvers which point to private artifactories and it works. Therefore, would it be possible to release version 1.2.8?

In case you missed the notification, I'm pinging again. Hey @aiyanbo!

Fixed in 1.2.8 and can be used by adding it to plugins.sbt.

addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.8")