Setting a key local.sbt so that it is applied in a multi-project

multi-project, nexus, resolver, sbt

Solution

Create a local plugin at `project/SetupCoursierPlugin.scala`:

import sbt._

import coursier.CoursierPlugin, CoursierPlugin.autoImport._

object SetupCoursierPlugin extends AutoPlugin {
  override def requires = CoursierPlugin
  override def trigger  = allRequirements

  override def projectSettings = Seq(
    coursierUseSbtCredentials := true
  )
}

Problem

How do I set key in a `local.sbt` in such a way that every subproject finds it ? I'm trying to use Coursier plugin in a multi project, but since I'm testing it, I'm trying not to check it in in our git repo. So I put it in my `project/local.sbt` and I was trying to set `coursierUseSbtCredentials := true` in a `local.sbt`. This has no visible effect. The authenticated nexus is defined in the `commonSettings` val in my build.sbt ``` val commonSettings = Seq( ... resolvers += "my-nexus" at "http://blah", credentials += ... ) ``` which every sub-project uses with `.settings(commonSettings)` (as per best-practices guide) If I put `coursierUseSbtCredentials := true` in `commonSettings` it does work, but then I'd have to add it in my `build.sbt`, which I would rather not do. How do I set this key so that every subproject can see it and in such a way that it is external to the `build.sbt` file ? (e.g. `local.sbt` ?)

Original source