通过配置xml文件,做到开发过程中tomcat 免部署

来源:互联网 发布:刀王娄四东淘宝 编辑:程序博客网 时间:2024/06/06 06:59

该方法是我在开发过程中,项目经理教的,就是解决在很大的项目(几百兆)中,重新部署花了很长时间的问题,希望能帮到为生活奔波的苦逼程序猿偷笑

步骤方案:

1.在tomcat 的安装目录下:(我是免安装版的)D:\Program Files (x86)\Apache Software Foundation\apache-tomcat-6.0.29\conf\Catalina\localhost(如果没有自建),建一个与工程名一样的xml文件(注意文件名要与工程名一样)。

2.文件内容是:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at


      http://www.apache.org/licenses/LICENSE-2.0


  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<Context path="/fjadmp" docBase="F:/workspace/fjadmp/WebRoot" debug="0" privileged="true"> 


</Context>

(注释:Context path是工程名,doBase是工程在本地硬盘的路径,到webroot 为止,其他照抄)


3.在myeclipse 中只要直接启动tomcat,不要部署(重点:千万不要部署)。

注意:该方法主要用于开发,故一个xml文件对应一个工程,如果换工程,只要加人另一个xml文件,修改原先xml文件的扩展名,如XXX.xmlbak

0 0
原创粉丝点击