在 tomcat 7 中使用 ant 任务取消部署会给出错误,即需要开机自检,而不是 GET



当我尝试使用 ant task 在 tomcat 7.0.30 中取消部署 Web 应用程序时,它给我的信息是

失败 - 已尝试通过 GET 请求使用命令/取消部署,但开机自检 必填

但是我找不到这个问题的任何解决方案。

我的蚂蚁任务是错误的吗?还是雄猫配置?

我的蚂蚁任务是...

<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>

而我的雄猫用户.xml是...

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

尝试使用此 url 而不是以"html"结尾的 url:

http://localhost:8080/manager/text

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

manager-script, admin-script

相关内容

最新更新