Web applications 在Tomcat7中使用ant任务取消部署会导致错误,即POST是必需的,而不是GET

Web applications 在Tomcat7中使用ant任务取消部署会导致错误,即POST是必需的,而不是GET,web-applications,ant,tomcat7,undeploy,Web Applications,Ant,Tomcat7,Undeploy,当我尝试使用ant任务在tomcat 7.0.30中取消部署一个webapp时,它会告诉我 失败-试图通过GET请求使用命令/取消部署,但POST失败 必需的 但我找不到解决这个问题的办法 是我的蚂蚁任务错了吗?还是tomcat配置 我的任务是 <path id="catalina-ant-classpath"> <fileset dir="${tomcat.base.dir}/lib"> <include name="catalin

当我尝试使用ant任务在tomcat 7.0.30中取消部署一个webapp时,它会告诉我

失败-试图通过GET请求使用命令/取消部署,但POST失败 必需的

但我找不到解决这个问题的办法

是我的蚂蚁任务错了吗?还是tomcat配置

我的任务是

<path id="catalina-ant-classpath">
    <fileset dir="${tomcat.base.dir}/lib">
            <include name="catalina-ant.jar"/>
            <include name="tomcat-coyote.jar"/>
            <include name="tomcat-util.jar"/>
    </fileset>
    <fileset dir="${tomcat.base.dir}/bin">
    <include name="tomcat-juli.jar"/>
    </fileset>
</path>

<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" classpathref="catalina-ant-classpath"/>
<target name="undeploy" description="undeploy from tomcat">
    <undeploy 
            url="http://localhost:8080/manager/html"
            username="admin"
            password="password"
            path="/mywebapp"
    />
</target>

我的tomcat-users.xml是

<user username="admin" password="password" roles="manager-gui, manager-jmx, manager-status"/>

尝试使用此url,而不是以“html”结尾的url:

您可能还需要在tomcat-users.xml中将这些角色添加到您的用户:

manager-script, admin-script

非常感谢你!你刚刚救了我的项目!
manager-script, admin-script