Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ant目标将war部署到tomcat7/webapps_Java_Ant_Tomcat7_War_Web Deployment - Fatal编程技术网

Java ant目标将war部署到tomcat7/webapps

Java ant目标将war部署到tomcat7/webapps,java,ant,tomcat7,war,web-deployment,Java,Ant,Tomcat7,War,Web Deployment,我想使用ant目标将刚刚创建的*.war(分解)部署到${TOMCAT_HOME}/webapps 配置 我的tomcat版本是7.0.37和tomcat用户。xml是: <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager-gui"/> <user username="tomcat" password="tomcat" roles="to

我想使用
ant
目标将刚刚创建的
*.war
(分解)部署到
${TOMCAT_HOME}/webapps

配置 我的tomcat版本是7.0.37和
tomcat用户。xml
是:

  <role rolename="tomcat"/>
  <role rolename="role1"/>
   <role rolename="manager-gui"/>

  <user username="tomcat" password="tomcat" roles="tomcat,manager-gui"/>
  <user username="both" password="tomcat" roles="tomcat,role1,manager-gui"/>
  <user username="role1" password="tomcat" roles="role1"/>
# War Build Properties

package.dir=${basedir}/package
war.exploded.dir=${deploy.dir}/war-ex
# --------- Tomcat Settings ---------------

# FIXME : tomcat.url=http://localhost:8080/manager/text
tomcat.url=http://localhost:8080/manager

tomcat.username=tomcat
tomcat.password=tomcat

context-path=/eccount
我的
deploywar
目标如下(
tomcat deploy.xml
):

但是,相同的路径
file:///C:/eccount/deploy/war-ex
可通过web浏览器访问

参考资料


这个问题已经解决了:

步骤1:更新AT7的tomcat管理器url 步骤2:向用户添加额外角色


多亏了

这个问题得到了解决:

步骤1:更新AT7的tomcat管理器url 步骤2:向用户添加额外角色

多亏了

<taskdef name="catalina-deploy"    classname="org.apache.catalina.ant.DeployTask"       classpathref="catalina.lib.classpath"/>
  <target name="deploy-war" depends="build-wardir" description="Install web app">
    <catalina-deploy url="${tomcat.url}" 
            username="${tomcat.username}" 
            password="${tomcat.password}"
            path="${context-path}" 
            localwar="file://${war.exploded.dir}"/>
  </target>
FileNotFoundException : http://localhost:8080/manager/deploy?path=%2Feccount&war=file%3A%2F%2FC%3A%5Ceccount%2Fdeploy%2Fwar-ex
 tomcat.url=http://localhost:8080/manager/text
  <role rolename="manager-script"/>

  <user username="tomcat" password="tomcat" roles="tomcat,manager-gui,manager-script"/>