मैं एक प्ले वेब ऐप को डॉकराइज़ करने की कोशिश कर रहा हूं और मैं एसबीटी-डॉकर का उपयोग कर रहा हूं। जब मैं एसबीटी डोकर निष्पादित मैं gollowing त्रुटि मिलती है:प्ले प्रोजेक्ट में एसबीटी-डॉकर से enablePlugins (DockerPlugin) क्यों देता है "त्रुटि: डॉकरप्लगिन का संदर्भ संदिग्ध है"?
error: reference to DockerPlugin is ambiguous;
it is imported twice in the same scope by
import _root_.sbtdocker.DockerPlugin
and import _root_.com.typesafe.sbt.packager.docker.DockerPlugin
enablePlugins(DockerPlugin)
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
मैं ऊपर त्रुटि मिलती है और मेरे build.sbt इस तरह दिखता है:
enablePlugins(DockerPlugin)
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test
)
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
// Make docker depend on the package task, which generates a jar file of the application code
docker <<= docker.dependsOn(sbt.Keys.`package`.in(Compile, packageBin))
// Define a Dockerfile
dockerfile in docker := {
val jarFile = artifactPath.in(Compile, packageBin).value
val classpath = (managedClasspath in Compile).value
val mainclass = mainClass.in(Compile, packageBin).value.getOrElse(sys.error("Expected exactly one main class"))
val jarTarget = s"/app/${jarFile.getName}"
// Make a colon separated classpath with the JAR file
val classpathString = classpath.files.map("/app/" + _.getName).mkString(":") + ":" + jarTarget
new Dockerfile {
// Base image
from("java")
// Add all files on the classpath
add(classpath.files, "/app/")
// Add the JAR file
add(jarFile, jarTarget)
// On launch run Java with the classpath and the main class
entryPoint("java", "-cp", classpathString, mainclass)
}
}
मेरे संदेह है कि है एसबीटी देशी-बंडल है एसबीटी-डॉकर के साथ विवादित। लेकिन मैं कहीं भी एसबीटी-देशी-पैकर आयात नहीं कर रहा हूं।