Search code examples
javamaventomcatdeploymentmaven-tomcat-plugin

Error 404 while deploying to Tomcat with Tomcat7 MVN plugin


I'm trying to deploy my project to Tomcat using Tomcat MVN plugin but I get the following error:

 Uploading: http://localhost:8080/manager/text/deploy?path=%2FSample
 Uploaded: http://localhost:8080/manager/text/deploy?path=%2FSample (90810 KB at 62283.7 KB/sec)

 [ERROR] Tomcat return http status error: 404, Reason Phrase: Not Found
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD FAILURE

The plugin configuration in the pom

<build>
      <plugins>
              .
              .
           <plugin>
                  <groupId>org.apache.tomcat.maven</groupId>
                  <artifactId>tomcat7-maven-plugin</artifactId>
                  <version>2.2</version>
           </plugin>
              .
              .
              .

I have no Tomcat users set in the pom because in my Tomcat configuration I don't have any users and need to kept it that way.

When I manually copy the war into the tomcat folder "webapps" it deploy with no issue.

I don't know what is missing... and I have try the followings with no result

Error while deploying to Tomcat: tomcatManager status code:404, ReasonPhrase:Not Found tomcatManager status code:404, ReasonPhrase:Not Found


Solution

  • Ok after a lot of research I found a way to deploy my project with Tomcat7 Maven Plugin. It's as simple as running the goal mvn tomcat7:run-war

    The only downside is that it use it own embedded Tomcat server

    I leave the documentation here