Skip to content

Instantly share code, notes, and snippets.

@bohrqiu
Last active December 31, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bohrqiu/8036530 to your computer and use it in GitHub Desktop.
Save bohrqiu/8036530 to your computer and use it in GitHub Desktop.
java web项目测试时启动jetty
1.在项目父pom中添加build插件:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.1.0.v20131115</version>
<configuration>
<reload>automatic</reload>
</configuration>
</plugin>
2.在web.xml中添加context-param防止jetty锁定静态文件
<context-param>
<param-name>org.eclipse.jetty.servlet.Default.useFileMappedBuffer</param-name>
<param-value>false</param-value>
</context-param>
3.启动jetty
mvn jetty:run -Dspring.profiles.active=dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment