3

我正在尝试通过 maven (mvn clean install tomcat7:deploy) 在 tomcat 上部署战争。部署似乎工作正常,但应用程序只有在我重新启动 tomcat 时才能工作。这是正常的?我想不是。

4

2 回答 2

1

通过contextReloadable>true</contextReloadable>这样设置:

    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <path>/yourApp</path>
            <contextReloadable>true</contextReloadable>
        </configuration>
    </plugin>

你得到一个解决方法:tomcat 会在检测到更改时重新加载应用程序。它不是热部署,但至少,您不会手动重新启动它。

于 2018-11-06T11:30:27.130 回答
1

tomcat7:deploy只负责将更新后的 WAR 文件放到 Tomcat 中:

将 WAR 部署到 Tomcat。

在war文件更改时使用Tomcat热部署,请参阅答案

于 2018-11-06T11:30:35.083 回答