我有一些问题,我无法解决。我在 D:/server/tomcat7 中解压缩了 tomcat 服务器,我想从 maven 启动它,以便将来在那里部署我的 WebApp。但我找不到如何配置外部文件夹以运行 tomcat。
如果我在 cmd mvn tomcat:run 中调用,maven 将下载 tomcat 并运行它,但我需要从我在上面指定的文件夹中启动服务器。
Tnx 寻求答案
我有一些问题,我无法解决。我在 D:/server/tomcat7 中解压缩了 tomcat 服务器,我想从 maven 启动它,以便将来在那里部署我的 WebApp。但我找不到如何配置外部文件夹以运行 tomcat。
如果我在 cmd mvn tomcat:run 中调用,maven 将下载 tomcat 并运行它,但我需要从我在上面指定的文件夹中启动服务器。
Tnx 寻求答案
您可以尝试 maven-exec-plugin 通过 ${CATALINA_HOME}/bin 中的脚本启动/停止 Tomcat:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>stop-tomcat</id>
<phase>pre-clean</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${tomcat.stop.path}</executable>
</configuration>
</execution>
<execution>
<id>start-tomcat</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${tomcat.start.path}</executable>
</configuration>
</execution>
</executions>
</plugin>
不可能,但我想知道你的用例是什么?这个插件的目标是避免这种手动安装。