我正在尝试将sbt-docker添加到我的播放网站的构建中,但我遇到了一个问题。由于某些原因,底层的Docker相关内容无法解决。无法解析码头相关的sbt标签
项目/ plugins.sbt
logLevel := Level.Warn
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
)
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.9")
build.sbt
name := "personal_site"
version := "1.1"
lazy val `personal_site` = (project in file(".")).enablePlugins(PlayScala,DockerPlugin)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(jdbc , cache , ws , specs2 % Test)
unmanagedResourceDirectories in Test <+= baseDirectory (_ /"target/web/public/test")
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
dockerfile in docker := {
val targetDir = "/usr/src"
new Dockerfile {
from("flurdy/activator")
//More goes here
}
}
imageNames in docker := Seq(
// Sets the latest tag
ImageName(s"${name.value}:latest"),
// Sets a name with a tag that contains the project version
ImageName(
namespace = None,
repository = name.value,
tag = Some("v" + version.value)
)
)
这里是什么样子的IntelliJ中
我也试过图像将addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.0")
添加到我的project/plugins.sbt
bu t我收到有关DockerPlugin
两次导入的错误。
~/Sync/Projects/Programming/Personal_Site (master ✘)✹ ᐅ sbt clean
[info] Loading project definition from /home/ryan/Sync/Projects/Programming/Personal_Site/project
/home/ryan/Sync/Projects/Programming/Personal_Site/build.sbt:5: 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
lazy val `personal_site` = (project in file(".")).enablePlugins(PlayScala,DockerPlugin)
当你删除导入时,'sbt compile'会工作吗?换句话说,你确定这是你的代码而不是IntelliJ的问题吗? – jackweirdy
你的意思是什么进口? –
对不起,我误读了错误信息。请粘贴你的plugins.sbt的内容,它看起来像你可能会导入两个不同的插件来创建码头图像,导致模糊 – jackweirdy