如何在xsbt-web-plugin上设置jetty的contextPath?

如何在xsbt-web-plugin上设置jetty的contextPath?,第1张

概述我在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 我在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/"

项目/ plugins.sbt

libraryDependencIEs <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.10"))

在运行容器之后,似乎configurationXml不起作用:在sbt控制台中启动,contextpath获取默认值“/”

我该如何更改contextpath?有小费吗?提前致谢!

解决方法 这是scalatra-user组的解决方案

将jetty-plus添加到依赖项:

"org.eclipse.jetty" % "jetty-plus" % "7.4.5.v20110725" % "container"

将其添加到build.sbt:

env in Compile := Some(file(".") / "jetty-env.xml" asfile)

在与build.sbt相同的目录中,创建jetty-env.xml:

<Configure >  <Set name="contextpath">/foo</Set></Configure>
总结

以上是内存溢出为你收集整理的如何在xsbt-web-plugin上设置jetty的contextPath?全部内容,希望文章能够帮你解决如何在xsbt-web-plugin上设置jetty的contextPath?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1054111.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存