Maven Tomcat7:Run 在 Eclipse 中自动终止



>伙计们,我知道在 maven(在 eclipse 中)中运行 tomcat7 插件非常容易,但由于我是 maven 结构的新手,我无法弄清楚我正在使用"tomcat:run"运行 maven build 并且正在工作,但我切换到在 pom 中配置的 maven 插件 tomcat7.xml 它启动它并停止并提供构建成功消息。 我如何改变它继续倾听?

这是我的 tomcate 插件设置

<plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <addContextWarDependencies>true</addContextWarDependencies>
                <fork>true</fork>
                <path>/</path>
                <port>8080</port>
                <httpsPort>8443</httpsPort>
                <keystoreFile>C:/Users/Sohail Haider/.keystore</keystoreFile>
                <keystorePass>apexsohail</keystorePass>
            </configuration>
            <executions>
                <execution>
                    <id>start-tomcat</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>run-war</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-tomcat</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>shutdown</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

考虑 maven 中的默认生命周期因此,您在配置中执行的操作是在构建项目时启动和停止 tomcat。我认为您有一个 web 应用程序项目并希望运行 tomcat,因此您必须从配置中删除执行标签并执行 mvn tomcat7:run

最新更新