How to deploy war file to tomcat using command prompt?

后端 未结 8 880
慢半拍i
慢半拍i 2021-01-30 11:05

I have created a war file and put into tomcat/webapps. How to deploy a war file to tomcat using command prompt?

8条回答
  •  悲&欢浪女
    2021-01-30 11:25

    You could use wget or curl to deploy an app from command line.

    With wget:

    wget --http-user=tomcat --http-password=tomcat "http://localhost:8080/manager/text/deploy?war=file:/some/path/SomeWar.war&path=/SomeWar" -O -
    

    But in my case with wget I received this error: "Failed to deploy application at context path ..."

    So I solved using curl:

    curl -v -u user:password -T app.war 'http://tomcathost/manager/text/deploy?path=/my-app-path&update=true'
    

提交回复
热议问题