简体   繁体   中英

Unable to redeploy the java application to tomcat7 using maven deployment

This is my pom.xml

<plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <url>http://192.168.10.42:8086/manager/html</url>
                    <server>TomcatServer</server>
                    <path>/MavenExample321</path>
                    <username>XXX</username>
                    <password>XXXXXX</password>
                </configuration>
 </plugin>

Am trying to redeploy the java application using maven using following command

mvn tomcat7:redeploy

am able to deploy but unable to redeploy application to same path second time, its giving the following error

[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] OK - Undeployed application at context path /MavenExample321
[INFO] FAIL - Failed to deploy application at context path /MavenExample321
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 56.490s
[INFO] Finished at: Wed Nov 25 11:00:38 IST 2015
[INFO] Final Memory: 16M/183M
[INFO] ------------------------------------------------------------------------

Finally I found the solution.

Use following update tag in configuration

<update>true</update>

and use the following command to undeploy last deployed application and redeploy the new war file with same name.

mvn clean tomcat:deploy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM