java - Eclipse Maven项目下,如何让eclipse自动编译修改后的源代码?
伊谢尔伦
伊谢尔伦 2017-04-18 10:33:15
0
2
985

之前用eclipse创建普通jave web项目
修改java源代码后,eclipse自动编译,不需要关闭和重启tomcat服务器

但是最近开始用maven构建
发现修改源代码后,eclipse没有自动编译
需要停止服务器,然后重启服务器来看修改后的状况
Eclipse Maven项目下,如何让eclipse自动编译修改后的源代码?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
迷茫

This has nothing to do with whether Maven is used to build it. This is a Tomcat setting problem, which is achieved through reloadable parameter settings. The specific settings are as follows:

【About reloadable】

If this attribute is set to true, the tomcat server will monitor changes in class files in the WEB-INF/classes and WEB-INF/lib directories while it is running. If it detects that a class file has been updated, the server will automatically restart Load the web application.
Set the reloadable attribute to true during the development phase, which is helpful for debugging servlets and other class files. However, this will increase the server operating load. It is recommended to set reloadable to false during the deployment phase of the web application.

【Setting method】
Modify the tomcatconfcontext.xml file
1. Under Tomcat, find server.xml under the conf file and open it.
2. Add the following code between <Host> and </host>:

<Context path="/虚拟目录名" docBase="目标目录位置" debug="0" reloadable="true" >
</Context>
左手右手慢动作

project -- build automatically try

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template