diff --git a/modules/definitions/src/main/scala/lmcoursier/CoursierConfiguration.scala b/modules/definitions/src/main/scala/lmcoursier/CoursierConfiguration.scala index 357a11a72..5e5c313c0 100644 --- a/modules/definitions/src/main/scala/lmcoursier/CoursierConfiguration.scala +++ b/modules/definitions/src/main/scala/lmcoursier/CoursierConfiguration.scala @@ -61,4 +61,6 @@ import java.net.URLClassLoader protocolHandlerDependencies: Seq[ModuleID] = Vector.empty, retry: Option[(FiniteDuration, Int)] = None, sameVersions: Seq[Set[InclExclRule]] = Nil, + @since + enableDependencyOverrides: Option[Boolean] = None, ) diff --git a/modules/lm-coursier/src/main/scala/lmcoursier/CoursierDependencyResolution.scala b/modules/lm-coursier/src/main/scala/lmcoursier/CoursierDependencyResolution.scala index 7dcb76e55..be3a45569 100644 --- a/modules/lm-coursier/src/main/scala/lmcoursier/CoursierDependencyResolution.scala +++ b/modules/lm-coursier/src/main/scala/lmcoursier/CoursierDependencyResolution.scala @@ -249,6 +249,7 @@ class CoursierDependencyResolution( .withMaxIterations(conf.maxIterations) .withProfiles(conf.mavenProfiles.toSet) .withForceVersion(conf.forceVersions.map { case (k, v) => (ToCoursier.module(k), v) }.toMap) + .withEnableDependencyOverrides(conf.enableDependencyOverrides) .withTypelevel(typelevel) .withReconciliation(ToCoursier.reconciliation(conf.reconciliation)) .withExclusions(excludeDependencies) diff --git a/modules/lm-coursier/src/main/scala/lmcoursier/syntax/package.scala b/modules/lm-coursier/src/main/scala/lmcoursier/syntax/package.scala index c4c3755b6..c5fd049a4 100644 --- a/modules/lm-coursier/src/main/scala/lmcoursier/syntax/package.scala +++ b/modules/lm-coursier/src/main/scala/lmcoursier/syntax/package.scala @@ -76,6 +76,7 @@ package object syntax { protocolHandlerDependencies = Vector.empty, retry = None, sameVersions = Nil, + enableDependencyOverrides = None, ) } @@ -112,6 +113,8 @@ package object syntax { def withRetry(retry: (FiniteDuration, Int)): CoursierConfiguration = value.withRetry(Some((retry._1, retry._2))) + def withEnableDependencyOverrides(enable: Boolean): CoursierConfiguration = + value.withEnableDependencyOverrides(Some(enable)) } implicit class PublicationOp(value: Publication) {