简体   繁体   中英

Moving web-inf/lib jars to Tomcat/myownlib during deployment

在此先感谢...我有7个Web应用程序,并且希望将所有各自的WEB-INF / lib都移到Tomcat / myownlib.I知道,可以通过手动复制它们并在catalina.properties中配置路径来轻松实现。但是,期望在战争未归档的部署过程中完成此操作,或者也欢迎任何建议自动执行此操作。

It's not possible to do it automatically during tomcat undeploy. There is no directive or process in tomcat.

But you have tagged the question as "maven-tomcat-plugin" If you are using maven to perform the deploy and launch server there is an alternative you create a plugin or use one like AntRun, gmaven-plugin, to execute an step before deploy that copy all libs into the shared tomcat folder and restarts tomcat.

Important! Is required to restart tomcat after copy the libraries. Shared libraries are loaded on start only.

Example:

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM