我正在使用sbt 0.11.1和xsbt-web-plugin 0.2.10
下面是build.sbt和plugins.sbt的内容
build.sbt
organization := "org"
name := "demo"
version := "0.1.0-SNAPSHOT"
scalaVersion := "2.9.1"
seq(webSettings :_*)
configurationXml :=
<configuration>
<webApp>
<contextPath>/foo</contextPath>
</webApp>
</configuration>
libraryDependencies ++= Seq(
"org.eclipse.jetty" % "jetty-webapp" % "7.4.5.v20110725" % "container",
"javax.servlet" % "servlet-api" % "2.5" % "provided"
)
resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
project/plugins.sbt
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.10"))
看起来configurationXml不起作用,在sbt控制台中运行container:start后,contextPath获取默认值“/”
我该如何更改contextPath?有什么建议吗?提前感谢!
configurationXml
,必须将customConfiguration
参数设置为true,否则它不会应用。然而,由于类路径等问题,我无法使其正常工作,并且没有找到任何工作的configurationXml
示例。它完全替换了xsbt-web-plugin完成的配置,因此必须从头开始配置所有内容:连接器、上下文处理程序、类路径等。 - kolen