【发布时间】:2015-10-09 06:58:32
【问题描述】:
在此先感谢... 我有 7 个 webapps 并希望将所有相应的 WEB-INF/lib 移动到 Tomcat/myownlib。我知道可以通过手动复制它们并在 catalina.properties 中配置路径来轻松完成。它工作正常。但期待它应该完成在部署期间,当战争被取消存档或任何建议也欢迎自动进行。
【问题讨论】:
标签: java tomcat tomcat7 tomcat8 maven-tomcat-plugin
在此先感谢... 我有 7 个 webapps 并希望将所有相应的 WEB-INF/lib 移动到 Tomcat/myownlib。我知道可以通过手动复制它们并在 catalina.properties 中配置路径来轻松完成。它工作正常。但期待它应该完成在部署期间,当战争被取消存档或任何建议也欢迎自动进行。
【问题讨论】:
标签: java tomcat tomcat7 tomcat8 maven-tomcat-plugin
在 tomcat undeploy 期间无法自动执行此操作。 tomcat中没有指令或进程。
但您已将问题标记为“maven-tomcat-plugin”部署之前的步骤,将所有库复制到共享的 tomcat 文件夹并重新启动 tomcat。
重要!复制库后需要重新启动 tomcat。共享库仅在启动时加载。
例子:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<move file="from file" tofile="to file"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
【讨论】: