zoukankan      html  css  js  c++  java
  • Tomcat源码分析-开篇(Tomcat源码部署运行 Maven方式)

    1.下载tomcat源码

    我这里下载的是 apache-tomcat-8.0.53-src.zip

    2.新建maven工程

    我这里创建一个maven工程,名称为 apache-tomcat-8.0.53-src

    3.pom.xml中添加相关依赖

    <dependency>
        <groupId>ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.6.5</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
        <artifactId>javax.wsdl</artifactId>
        <version>1.5.1</version>
    </dependency>
    
    <dependency>
        <groupId>org.eclipse.jdt</groupId>
        <artifactId>org.eclipse.jdt.core</artifactId>
        <version>3.10.0</version>
    </dependency>
    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxrpc</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.1</version>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.4</version>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>
    4.拷贝源码包下的目录
    • 将解压的源码下的 conf目录、webapps目录、拷贝至新建项目的根目录
    • 将解压的源码下的 java目录、test目录 srcmain 目录下
    • 删除webapps目录下的 examples 目录(否则启动的过程中会提示找不到类)
    目录结构如下:
     
     
    5.修改 ContextConfig 中的 configureStart() 方法

    在configureStart() 方法末尾添加这行代码: context.addServletContainerInitializer(new JasperInitializer(), null);

    6.启动

    找到BootStarp 类,执行main方法就可以启动tomcat了

  • 相关阅读:
    Asp.Net上传大文件(页面超时)
    C#文件的大小
    设计模式简单工厂、工厂方法、抽象工厂方法
    设计模式迭代器模式
    Asp.Net下载文件
    设计模式桥接模式
    CSS尺寸(Dimensions)
    设计模式单件模式
    Android 换肤
    像QQtab切换效果的例子
  • 原文地址:https://www.cnblogs.com/caoxb/p/12512996.html
Copyright © 2011-2022 走看看