简介:
jetty-maven-plugin用于maven项目的快速开发与测试。需要它时,像添加其它插件一样添加到maven项目中。
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.4.v20120524</version> </plugin>
它可以周期性地查看web应用,当应用有修改时,会立即重部署。运行jetty的命令即:
maven jetty:run
默认端口为:8080
配置jetty容器
配置web应用
插件为web应用提供了如下的配置参数:
一个简单的例子:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.4.v20120524</version> <configuration> <scanIntervalSeconds>5</scanIntervalSeconds> <webApp> <contextPath>/test</contextPath> </webApp> </configuration> </plugin>
jsf
在利用此插件运行jsf时,需要在web.xml文件中加入监听器。
扫描二维码关注公众号,回复:
373986 查看本文章
myfaces:
<listener> <listener-class> org.apache.myfaces.webapp.StartupServletContextListener </listener-class> </listener>
sun-jsf:
<listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener>