From 0816e76028760dbb593628fb1e5b808a60e590f7 Mon Sep 17 00:00:00 2001 From: Brice Jaglin Date: Sun, 11 Feb 2024 12:11:02 +0100 Subject: [PATCH] force usage of custom scalameta for mdoc Coursier seems to prefer mdoc's scalameta 4.8.15 over core2_13's scalameta 4.8.15+150-a7c0baa0-SNAPSHOT. Adding scalameta as a top-level docs2_13 libraryDependencies does change this behavior, so I suspect Coursier is following nearest-wins semantics for some reason, while we expect it to following latest-wins semantics. http://eed3si9n.com/dependency-resolver-semantics#coursiers-latest-wins-semantics By using dependencyOverrides, we ensure that docs run are generated with the actual scalameta version used in scalafix, rather than the one used in mdoc. --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 2ea5da1b3..38122c9c7 100644 --- a/build.sbt +++ b/build.sbt @@ -383,7 +383,8 @@ lazy val docs = projectMatrix scalacOptions += "-Wconf:msg='match may not be exhaustive':s", // silence exhaustive pattern matching warning for documentation scalacOptions += "-Xfatal-warnings", mdoc := (Compile / run).evaluated, - libraryDependencies += metaconfigDoc + libraryDependencies += metaconfigDoc, + dependencyOverrides += scalameta // force eviction of mdoc transitive dependency ) .defaultAxes(VirtualAxis.jvm) .jvmPlatform(scalaVersions = Seq(scala213))