码迷,mamicode.com
首页 > 其他好文 > 详细

Maven Jetty Plugin

时间:2016-09-18 14:54:46      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

热部署maven项目代码

 

pom.xml

     <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.plugin.version}</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <scanTargets>
                        <!-- Working better with compiling specific java class -->
                        <scanTarget>src/main</scanTarget>
                        <scanTarget>pom.xml</scanTarget>
                    </scanTargets>
                    <httpConnector>
                        <port>${jetty.http.port}</port>
                    </httpConnector>
                </configuration>
            </plugin>

 

运行mvn jetty:run后,如果修改了代码,可以使用mvn compile或IDE右键compile 编译新的代码,然后就可以自动热部署了

 

参考:

https://www.eclipse.org/jetty/documentation/9.3.x/jetty-maven-plugin.html

http://stackoverflow.com/questions/6719406/jetty-autorefresh-autoload-for-quick-testing

Maven Jetty Plugin

标签:

原文地址:http://www.cnblogs.com/7explore-share/p/5881247.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!