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

IntelliJ + Maven + 内Jetty 实现热部署项目

时间:2017-07-28 15:43:37      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:intel   seconds   ips   strong   path   分享   热部署   步骤   eclips   

部署的好处:代码修改后,不必关闭Jetty再重新启动,Maven启动时间不太和谐技术分享。 

环境:

IntelliJ IDEA11.1.4, 

Maven2.2.1 

Jetty8.1.5
 

 

步骤:

1,在pom.xml文件中配置jetty插件的参数:scanIntervalSeconds,我的pom.xml片断如下:

<plugin>                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                    <stopPort>9966</stopPort>
                    <stopKey>foo</stopKey>
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>7777</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                    <webAppConfig>
                        <contextPath>/jsf-web</contextPath>
                    </webAppConfig>
                </configuration>
            </plugin>

 

2,当修改了java文件时,在IntelliJ中按:‘Ctrl+Shift+F9’ 将重新编译该java文件, 
如果修改了多个java文件,按‘Ctrl+F9’ 可以重新编译整个工程。

IntelliJ + Maven + 内Jetty 实现热部署项目

标签:intel   seconds   ips   strong   path   分享   热部署   步骤   eclips   

原文地址:http://www.cnblogs.com/hzm112567/p/7250144.html

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