Last active
December 31, 2015 19:49
-
-
Save bohrqiu/8036530 to your computer and use it in GitHub Desktop.
java web项目测试时启动jetty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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