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