Why does enablePlugins(DockerPlugin) from sbt-docker in Play project give "error: reference to DockerPlugin is ambiguous"? Why does enablePlugins(DockerPlugin) from sbt-docker in Play project give "error: reference to DockerPlugin is ambiguous"? docker docker

Why does enablePlugins(DockerPlugin) from sbt-docker in Play project give "error: reference to DockerPlugin is ambiguous"?


If there's a conflict then use the full name.

enablePlugins(sbtdocker.DockerPlugin)


As the message says "and import _root_.com.typesafe.sbt.packager.docker.DockerPlugin" sbt-native-packager comes with the conflicting DockerPlugin class. But that's what you know already.

The trick is that the Play plugin depends on sbt-native-packager to...ease people's lifes and hence the conflict (sorry, too much help might break people's lifes :)).

A solution is to use fully-qualified plugin class names as @pfn recommended or disablePlugins(SbtNativePackager).

See http://www.scala-sbt.org/sbt-native-packager/topics/play.html.