tomcat源码编译

tomcat源码编译

1. 下载tomcat源码,
   这里使用tomcat 7 ,jdk 1.8
   下载地址:

   http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.84/src/apache-tomcat-7.0.84-src.zip

2. 解压源码.
3. 新建一个eclipse java工程(非web)
4. 将源码src文件夹中的所有文件复制到java工程的src中.
5. 在eclipse项目根目录下新建lib文件夹,用于存放jar文件.

   如图:

   
6. 下载用到的jar包.
   maven配置如下:

<!-- https://mvnrepository.com/artifact/org.apache.ant/ant -->
<dependency>
    <groupId>org.apache.ant</groupId>
    <artifactId>ant</artifactId>
    <version>1.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/axis/axis-jaxrpc -->
<dependency>
    <groupId>axis</groupId>
    <artifactId>axis-jaxrpc</artifactId>
    <version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
<dependency>
    <groupId>wsdl4j</groupId>
    <artifactId>wsdl4j</artifactId>
    <version>1.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jdt/org.eclipse.jdt.core -->
<dependency>
    <groupId>org.eclipse.jdt</groupId>
    <artifactId>org.eclipse.jdt.core</artifactId>
    <version>3.13.100</version>
</dependency>


7. 将源码中的conf文件夹和webapps文件夹复制到eclipse项目根目录.
8. 找到 org.apache.catalina.startup.Bootstrap类,直接运行.
9. 如果运行后报错,可能是由于examples使用了一些其他jar文件,这里直接删除examples.

 

转载于:https://my.oschina.net/u/2528964/blog/1618014

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值