I am learning the basics of tomcat, and although I tried to deploy my web application to tomcat, I get the following error.
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project struts2-demoapp: Cannot invoke Tomcat manager: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/html/deploy?path=%2FmkyWebApp&war= -> [Help 1] [ERROR]
according to this, it seems that the location of the war file is not being transferred to tomcat manager. In my tomcat-user.xml
There are the following entries:
tomcat-users> <user name="admin" password="admin" roles="admin,manager" /> <role rolename="manager"/> <role rolename="admin"/> <user username="admin" password="admin" roles="admin,manager"/> </tomcat-users>
here are the details of pom.xml
<build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <packagingExcludes>WEB-INF/web.xml</packagingExcludes> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <configuration> <warFile>${project.build.directory}/${project.build.finalName}.war</warFile> <url>http://localhost:8080/manager/html</url> <server>myserver</server> <path>/mkyWebApp</path> </configuration> </plugin> </plugins> </build>
there are entries in my settings.xml
<server> <id>Tomcat6.x</id> <username>admin</username> <password>admin</password> </server>
Iām not sure what exactly is happening wrong here. Help in this regard will be helpful.
source share