0

Guys I know its very easy to run tomcat7 plugin in maven(in eclipse) but as I'm new to maven structure I can't figure it out that I was running maven build with "tomcat:run" and was working but I switched to maven plugin tomcat7 configured in pom.xml It starts it and stopped and gives build success msg. how change i make it keep listening?

Here my tomcate plugin settings

<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>
Sohail Haider
  • 166
  • 1
  • 11

1 Answers1

0

Take into account the default lifecycle in maven So, what you are doing in the configuration is starting and stopping tomcat when you are building the project. I think that you have a webapp project and want to run tomcat so you have to remove executions tag from the configuration and just execute mvn tomcat7:run

Eddú Meléndez
  • 6,107
  • 1
  • 26
  • 35