如何将我的web应用程序作为根应用程序部署到jetty9?

如何将我的web应用程序作为根应用程序部署到jetty9?,jetty,Jetty,当我使用jetty6时,我使用以下各项: <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Required minimal context configuration : -->

当我使用jetty6时,我使用以下各项:

<Configure class="org.mortbay.jetty.webapp.WebAppContext">


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Required minimal context configuration :                        -->
  <!--  + contextPath                                                  -->
  <!--  + war OR resourceBase                                          -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Set name="contextPath">/</Set>
  <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webapps/myapp</Set>

</Configure>

/
/webapps/myapp
此文件位于名为myapp.xml的文件夹上下文中

但是切换到jetty 9,首先没有这样的文件夹“contexts”,我将myapp.xml放入webapps,就像test.xml一样,重新启动jetty并导航到
http://localhost:8080
,页面仍为默认页面,而不是我的应用程序

谁能给我一个提示吗?

在6号码头,如果你有

${jetty.home}/contexts/myapp.xml
使用Jetty 9.0,将其移动到

${jetty.home}/webapps/myapp.xml
${jetty.base}/webapps/myapp.xml
使用Jetty 9.1+,将其移动到

${jetty.home}/webapps/myapp.xml
${jetty.base}/webapps/myapp.xml
确保分解的webapp目录与xml文件的名称相同,以防止重复部署

您还需要更改Jetty 9的上下文XML文件


/
/webapps/myapp
或者,只需命名分解的webapp目录即可

${jetty.home}/webapps/ROOT
发现的文件:


为Jetty 9.1更新了您可以使用特别命名的
/root
root.war
。请参阅。

“不工作”从来都不是一个足够的问题描述。谢谢,似乎正在工作,从日志中我可以看到我的应用程序已部署,但“”页面仍然是默认页面。我希望我的应用程序是根应用程序。稍晚一点,但仅供参考:此方法有效,但仅当您移动或重命名现有的webapps/root目录时。资料来源:未在文件中找到,即试验和错误。我在Debian/stretch上使用jetty 9.2。