Possible extension for versionScheme checking?

The addition of versionScheme and EvictionError and related logic in sbt has been really good. The ability to flunk CI if an eviction would be incompatible has ended up being very helpful for me personally, especially while porting things to Scala 3.

But I just ran into a case this morning that sbt can’t handle as far as I know, and maybe it shouldn’t because it’s so weird, but I figured I would mention it:

One of our internal libraries pulls in Monocle 2.0.1, another pulls in Monocle 3.1.0 … when I depend on both I would expect to get a warning (or error, if versionScheme were set). However the Maven coordinates for Monocle changed (the org went from com.github.julien-truffaut to dev.optics) when they moved to v3, and as far as I can tell sbt has no way to know that they’re actually the same dependency. The end result was both artifacts on the classpath and a runtime error.

So it would be cool if library maintainers could leave some kind of crumb in the POM that sbt could use to follow the linkage if coordinates change. I acknowledge that this is a really unusual circumstance and the payoff/effort ratio would be very low. I mostly just wanted to register the issue in case anyone else runs into it.

Again, thanks for all your hard work. The new eviction stuff is great.

Note that Scala Steward knows about a lot of the org changes that have occurred; the knowledge is in scala-steward/artifact-migrations.conf at master · scala-steward-org/scala-steward · GitHub

So that’s a resource that a new feature or a new plugin in this area could draw on.

1 Like