【问题标题】:maven tomcat7:run terminates automaticatlly in eclipsemaven tomcat7:运行在eclipse中自动终止
【发布时间】:2015-02-04 15:35:18
【问题描述】:

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

这里是我的 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 eclipse-plugin maven-tomcat-plugin maven-eclipse-plugin


    【解决方案1】:

    考虑到default lifecycle in maven 因此,您在配置中所做的是在构建项目时启动和停止 tomcat。我认为您有一个 webapp 项目并想要运行 tomcat,因此您必须从配置中删除 executions 标记并执行 mvn tomcat7:run

    【讨论】:

      猜你喜欢
      • 2017-05-09
      • 2015-05-24
      • 1970-01-01
      • 2020-09-21
      • 1970-01-01
      • 2016-07-12
      • 1970-01-01
      • 2014-04-02
      • 2011-12-22
      相关资源
      最近更新 更多