【发布时间】:2014-06-13 18:50:33
【问题描述】:
我已通过 SBT 项目配置为使用 xsbt-web-plugin 进行 Web 部署。描述这一点的文档似乎是:
这是我迄今为止根据阅读文档所做的:
我已经创建了 plugins.sbt:
resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.9.0")
在 build.sbt 中添加了以下几行:
Seq(webSettings :_*)
// disable .jar publishing
publishArtifact in (Compile, packageBin) := false
// create an Artifact for publishing the .war file
artifact in (Compile, packageWar) := {
val previous: Artifact = (artifact in (Compile, packageWar)).value
previous.copy(`type` = "war", extension = "war")
}
// add the .war file to what gets published
addArtifact(artifact in (Compile, packageWar), packageWar)
使用sbt加载项目时,插件被下载,但报如下错误:
[error] Reference to undefined setting:
[error]
[error] *:packageWar from *:$local (W:\Tempi\TempiJetty\build.sbt:48)
[error] Did you mean compile:packageWar ?
在最后一行写 compile:packageWar 而不是 packageWar 会导致不同的错误:
[info] Loading project definition from W:\Tempi\TempiJetty\project
W:\Tempi\TempiJetty\build.sbt:48: error: not found: type packageWar
addArtifact(artifact in (Compile, packageWar), compile:packageWar)
^
[error] Type error in expression
我应该怎么写才能让我的 SBT 项目支持战争打包?
【问题讨论】:
标签: sbt war xsbt-web-plugin