diff --git a/README.md b/README.md index d1fb2d04..c57c1397 100644 --- a/README.md +++ b/README.md @@ -143,3 +143,16 @@ To make `mimaReportBinaryIssues` not fail you may want to do one of the followin * avoid calling `mimaPreviousArtifacts` when binary compatibility checking isn't needed * set `mimaFailOnNoPrevious := false` on specific projects that want to opt-out (alternatively `disablePlugins(MimaPlugin)`) * set `mimaFailOnNoPrevious in ThisBuild := false`, which disables it build-wide, effectively reverting back to the previous behaviour + +## Setting mimaPreviousArtifacts when name contains a "." + +To refer to the project name in `mimaPreviousArtifacts`, use `moduleName` rather +than `name`, like +```scala +mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "0.1.0") +``` + +Unlike `name`, `moduleName` escapes characters like `.`, and is the name +actually used by `publish` and `publishLocal` to publish your project. It's +also the value your users should use when adding a dependency towards your +project. diff --git a/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/MimaPlugin.scala b/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/MimaPlugin.scala index fc22df25..df45d778 100644 --- a/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/MimaPlugin.scala +++ b/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/MimaPlugin.scala @@ -46,8 +46,8 @@ object MimaPlugin extends AutoPlugin { case previousArtifacts => previousArtifacts.iterator.map { m => val moduleId = CrossVersion(m, scalaModuleInfo.value) match { - case Some(f) => m.withName(f(Project.normalizeModuleID(m.name))) - case None => m // no module id normalization if it's fully declaring it (using "%") + case Some(f) => m.withName(f(m.name)) + case None => m } moduleId -> SbtMima.getPreviousArtifact(moduleId, ivy, taskStreams) }.toMap