Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-47

Goal "exploded" does deploys before undeploy is finished

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 1.0-beta-1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      For integration tests we want to deploy an exploded webapp into tomcat. But this fails if we deployed the webapp in a previous run as the deployment seems to start before the undeployment is actually done.

      This is the code snippet we use for deployment. Mind the "update=true" which should do the undeployment:

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>tomcat-maven-plugin</artifactId>
              <version>1.0-beta-1</version>
              <executions>
                <execution>
                  <id>deploy</id>
                  <goals>
                    <goal>exploded</goal>
                  </goals>
                  <phase>compile</phase>
                  <configuration>
                    <url>http://localhost:8001/manager</url>
                    <username>some</username>
                    <password>someother</password>
                    <warDirectory>/webapp</warDirectory>
                    <path>/</path>
                    <update>true</update>
                  </configuration>
                </execution>
              </executions>
            </plugin>
      

      From the log:

      [INFO] --- tomcat-maven-plugin:1.0-beta-1:exploded (deploy) @ tomcat-deployment ---
      [DEBUG] Created new class realm plugin>org.codehaus.mojo:tomcat-maven-plugin:1.0-beta-1
      [DEBUG] Populating plugin realm for org.codehaus.mojo:tomcat-maven-plugin:1.0-beta-1
      [DEBUG]   Included: org.codehaus.mojo:tomcat-maven-plugin:maven-plugin:1.0-beta-1
      [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
      [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0
      [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0
      [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.0.4
      [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
      [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
      [DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
      [DEBUG]   Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
      [DEBUG]   Included: commons-codec:commons-codec:jar:1.3
      [DEBUG]   Included: org.apache.tomcat:catalina:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:servlet-api:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:juli:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:annotations-api:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:catalina-ha:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:coyote:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:tribes:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:el-api:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:jasper:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:jsp-api:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:jasper-jdt:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:jasper-el:jar:6.0.16
      [DEBUG]   Included: org.apache.tomcat:dbcp:jar:6.0.16
      [DEBUG] Configuring mojo 'org.codehaus.mojo:tomcat-maven-plugin:1.0-beta-1:exploded' with basic configurator -->
      [DEBUG]   (f) charset = ISO-8859-1
      [DEBUG]   (f) contextFile = ...\META-INF\context.xml
      [DEBUG]   (f) mode = war
      [DEBUG]   (f) packaging = war
      [DEBUG]   (f) password = ...
      [DEBUG]   (f) path = /editor
      [DEBUG]   (f) update = true
      [DEBUG]   (f) url = http://localhost:8001/manager
      [DEBUG]   (f) username = ...
      [DEBUG]   (f) version = 1.0-beta-1
      [DEBUG]   (f) warDirectory = ...\webapp
      [DEBUG] -- end configuration --
      [INFO] Deploying war to http://localhost:8001/editor
      [DEBUG] No server specified for authentication - using defaults
      [INFO] OK - Undeployed application at context path /editor
      [INFO] FAIL - Application already exists at path /editor
      

      Thus the deployment fails because undeployment is still incomplete.

      Workarounds:

      • Manually clean before doing the deployment.

        Activity

        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        must not be a problem with recent version.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - must not be a problem with recent version.
        Hide
        Mark Thomas added a comment -

        so as we are only using the tomcat manager (through a kind of wget call) I'm not really sure it's a mojo issue.
        Are you using an old tomcat version ?

        Show
        Mark Thomas added a comment - so as we are only using the tomcat manager (through a kind of wget call) I'm not really sure it's a mojo issue. Are you using an old tomcat version ?

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Michaelis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development