我正在为我的网络应用程序使用 Maven 来构建、启动和处理库。所以我运行 tomcat7:run 来开发我的应用程序...但是如果我更改代码,tomcat 将不会自动重新加载代码更改,因此我需要重新启动。在使用 Maven 之前,我使用“Sysdeo Eclipse Tomcat Launcher 插件”来运行和创建我的项目。这个插件允许即时查看代码更改,我知道 PLAY!框架做同样的事情。所以可以配置maven在运行时重新加载我的代码更改吗?我会提高我的工作进度...
最佳答案
可以通过确保 Tomcat context is reloadable 自动重新加载代码更改。 .
tomcat7:run
目标允许您使用 contextReloadable
parameter 启用上下文重新加载必须在插件的 configuration
部分进行配置:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<contextReloadable>true</contextReloadable>
</configuration>
</plugin>
关于java - 在 Maven 中集成 Tomcat 重新加载源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19901200/