Uploaded image for project: 'Apache Tomcat Maven Plugin'
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-305

shutdown not correct working if embedded tomcat is started twice in same maven build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2
    • None
    • tomcat7
    • multi-module project

    Description

      We have a multi-module project with the modules A and B.
      In module A we start and stop an embedded tomcat server within our integration tests; same in module B.

      The integration-tests for module A work perfectly. But after this, the start of the embedded tomcat server for module B is not working because the port 8080 is still in use from the integration test of module A.
      The reason is that the shutdown on module A invokes on the Catalina Container the "stop()" method, this method does not unbind the port 8080.
      I think - specially in this scenario - the shutdown mojo should also invoke the "destroy()" method after the "stop()" method on the Catalina Container. If this is not possible in every case, it would be great to have a parameter for the shutdown goal to specify if "stop" or "stop & destroy" should be called on the Catalina Container.

      <plugins>
      <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.2</version>
      <executions>
      <execution>
      <id>tomcat-run</id>
      <goals>
      <goal>run-war-only</goal>
      </goals>
      <phase>pre-integration-test</phase>
      </execution>
      <execution>
      <id>tomcat-shutdown</id>
      <goals>
      <goal>shutdown</goal>
      </goals>
      <phase>post-integration-test</phase>
      </execution>
      </executions>
      <configuration>
      <port>8080</port>
      <fork>true</fork>
      </configuration>

      Attachments

        Activity

          People

            olamy Olivier Lamy
            orm Oriel Maute
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified