没有在${jetty_home}下建立一个work目录的话,jetty会默认解压在/temp/下。
所以当我们部署某个项目的时候,发现还需要重新部署。原因就在这里。
放在webapps下的war包,只要在jetty安装目录下建一个work目录,就会解压到work目录下。
对应的app.war的配置文件,是在app.xml(需要自己新建 同名文件);
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/app.war</Set>
</Configure>
jetty 启动命令(v9.3.10)
java -jar start.jar --module=http jetty.http.port=80
这里在启动的时候指定了模块(http)和端口jetty.http.port
module就是${jetty_home}/module中的名字对应的配置文件,例如:http.mod中jetty.http.port=8080