远程部署Tomcat
2010-01-17 19:58
190 查看
Step1) 配置客户端
将服务端的${CATALINA_HOME}/lib/catalina-ant.jar拷贝到客户端的${ANT_HOME}/lib
客户端的${ANT_HOME}在本文中指的是D:/dev/eclipse/plugins/org.apache.ant_1.6.5/lib
即eclipse自带的ant目录,为了让eclipse自带的ant能正常运行任务,你还得将这个jar添加到eclipse的ant的classpath中(windows-->preferences-->Ant-->runtime-->classpath)
你完全可以不使用eclipse自带的ant,上面的步骤显得很麻烦,你完全可以开启dos窗口运行ant,但这样的话你就的两边切换窗口,一边在eclipse下写代码,一边在dos下运行ant,根据的自己的实际情况取舍吧
Step2) 配置服务器
我们主要通过tomcat manager api来完成部署工作,这个需要权限,所以你的修改
$CATALINA_HOME/conf/tomcat-users.xml加入
<user name="craigmcc" password="secret" roles="manager" />
将服务端的${CATALINA_HOME}/lib/catalina-ant.jar拷贝到客户端的${ANT_HOME}/lib
客户端的${ANT_HOME}在本文中指的是D:/dev/eclipse/plugins/org.apache.ant_1.6.5/lib
即eclipse自带的ant目录,为了让eclipse自带的ant能正常运行任务,你还得将这个jar添加到eclipse的ant的classpath中(windows-->preferences-->Ant-->runtime-->classpath)
你完全可以不使用eclipse自带的ant,上面的步骤显得很麻烦,你完全可以开启dos窗口运行ant,但这样的话你就的两边切换窗口,一边在eclipse下写代码,一边在dos下运行ant,根据的自己的实际情况取舍吧
Step2) 配置服务器
我们主要通过tomcat manager api来完成部署工作,这个需要权限,所以你的修改
$CATALINA_HOME/conf/tomcat-users.xml加入
<user name="craigmcc" password="secret" roles="manager" />
<project name="My Application" default="war" basedir="."> <!-- Configure the directory into which the web application is built --> <property name="build" value="${basedir}/WebRoot/WEB-INF/classes" /> <property name="dist.dir" value="${basedir}/dist" /> <!-- Configure the context path for this application --> <property name="path" value="/MFMS" /> <!-- Configure properties to access the Manager application --> <property name="url" value="http://192.168.23.165:8085/manager" /> <property name="username" value="admin" /> <property name="password" value="admin" /> <!-- Configure the custom Ant tasks for the Manager application --> <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" /> <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" /> <!-- Executable Targets --> <target name="war" description="package web application"> <war destfile="${dist.dir}/MFMS.war" webxml="WebRoot/WEB-INF/web.xml"> <classes dir="WebRoot/WEB-INF/classes" /> <fileset dir="WebRoot" excludes="WEB-INF/**" /> <lib dir="WebRoot/WEB-INF/lib" /> </war> </target> <target name="deploy" description="Install web application" depends="war"> <deploy url="${url}" username="${username}" password="${password}" path="${path}" war="${dist.dir}/MFMS.war" /> </target> <target name="undeploy" description="Remove web application"> <undeploy url="${url}" username="${username}" password="${password}" path="${path}" /> </target> </project>
相关文章推荐
- Maven自动部署至远程Tomcat
- Jenkins自动部署到(远程)tomcat服务器
- maven 实现tomcat的远程部署
- maven之远程部署到Tomcat
- 用 Maven 部署 war 包到远程 Tomcat 服务器
- springboot 项目 打包 部署到远程tomcat服务器
- maven部署web项目到远程服务器的Tomcat,以及输入IP地址直接访问到这个web项目
- 远程热部署项目到tomcat服务器中
- Tomcat远程部署web项目到服务器
- Ant远程部署到Tomcat
- Jenkins远程部署war包到tomcat
- Maven远程部署web工程到Tomcat7中
- Myeclipse8.6+maven3+tomcat6开发加远程部署应用
- cargo远程部署项目到tomcat
- 用Maven部署war包到远程Tomcat服务器
- 用Maven部署war包到远程Tomcat服务器
- Tomcat 远程部署 Maven项目
- 远程部署tomcat工程到Linux服务器
- Jenkins部署Web项目到远程tomcat
- 用Eclipse远程调试部署在Tomcat下的Web应用程序