关于maven-jetty-plugin的说明:
pom文件中:
- <build>
- <finalName>freemarker</finalName>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.22</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <useTestClasspath>true</useTestClasspath>
- <webAppConfig>
- <contextPath>/freemarker</contextPath>
- </webAppConfig>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8080</port>
- </connector>
- </connectors>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
说明:
1.<scanIntervalSeconds>10</scanIntervalSeconds> 表示热部署时间
2.<useTestClasspath>true</useTestClasspath> 默认为fasle,true表示web.xml读取配置文件都是从src/test/resources中读取
3.<contextPath>/freemarker</contextPath>访问项目名为freemarker,若不需要项目名则直接为 /
启动maven命令为: jetty:run