tag:web web项目 项目 热部署 热加载
老是重新启动项目,尤其是大些的项目,很慢很烦人。如果能热部署,至少可以节约些时间~
#1 以前的项目用一个tomcat的热部署工具,但需要花钱买正版
#2 tomcat
现在有manager,可以重新加载某个项目。
配置:
$TOMCAT_HOME/conf/tomcat-users.xml
<tomcat-users> <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. --> <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. --> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <!-- <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="role1" password="tomcat" roles="role1"/> --> <user username="myNameFantaxy" password="111222" roles="tomcat,role1,manager-gui,manager-script,manager-jmx,manager-status"/> </tomcat-users>
打开地址: http://localhost:8080/manager/
#3 jetty
如robbin所言,我是根本不部署。直接在我的Eclipse项目里面引入jetty的jar,然后自己写一个Main类启动jetty,换句话说就是把jetty嵌入到我的Eclipse项目里面来。