Tomcat source Parsing (a) Download the source code and import eclipse

Source: Internet
Author: User

Since the Web program was written, how the Web program is running in Tomcat has been confusing me, do not know the underlying mechanism is unable to really understand the web, so began to study Tomcat source, Tomcat is a lightweight Java server, and then combined with the " How Tomcat works and the online Daniel Blog are also known for their internal operating architectures.

First go to the official website to download tomcat source code, I downloaded is apache-tomcat-7.0.63-src (download here), because the source code using Ant and Maven management, so to use Ant or maven compiled for the Eclipse project. The Ant method compiles with a lot of errors and problems, so this is where Maven compiles it.

First, you will download theapache-tomcat-7.0.50-src.tar.gzUnzip totomcatdirectory, and then in thetomcatdirectory, create apom.xmlfile with the following contents:

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org /2001/xmlschema-instance "xsi:schemalocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4 _0_0.xsd "> <modelVersion>4.0.0</modelVersion> <groupId>net.imtiger</groupId> <artif Actid>tomcat-study</artifactid> <name>tomcat 7.0 study</name> <version>1.0</version&    Gt    <packaging>pom</packaging> <modules> <module>apache-tomcat-7.0.63-src</module> </modules></project> 
and then in apache-tomcat-7.0.63-src directory to create a pom.xmlfile with the following contents:


<?xml version= "1.0" encoding= "UTF-8"? ><project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http: Www.w3.org/2001/XMLSchema-instance "xsi:schemalocation=" http://maven.apache.org/POM/4.0.0/http Maven.apache.org/xsd/maven-4.0.0.xsd "> <modelVersion>4.0.0</modelVersion> <groupId> Org.apache.tomcat</groupid> <artifactId>Tomcat7.0</artifactId> <name>tomcat7.0</name > <version>7.0</version> <build> <finalName>Tomcat7.0</finalName> &lt        ;sourcedirectory>java</sourcedirectory> <testSourceDirectory>test</testSourceDirectory> <resources> <resource> <directory>java</directory> </reso urce> </resources> <testResources> <testResource> <directo Ry>test</directory> &LT;/TESTRESOURCe> </testResources> <plugins> <plugin> <groupid>org.apa                Che.maven.plugins</groupid> <artifactId>maven-compiler-plugin</artifactId> <version>2.3</version> <configuration> <encoding>utf-8</enco                Ding> <source>1.6</source> <target>1.6</target>        </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactid>junit</artifacti        d> <version>4.4</version> <scope>test</scope> </dependency> <dependency> <groupId>ant</groupId> <artifactid>ant</artifactid&gt            ; <version>1.7.0</version> </dependency> <dependency> <groupid>wsdl4j</groupi d> <artifactId>wsdl4j</artifactId> <version>1.6.2</version> </d ependency> <dependency> <groupId>javax.xml</groupId> <artifactid>j axrpc</artifactid> <version>1.1</version> </dependency> <dependency&gt            ;            <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>4.2.2</version> </dependency> </dependencies></project>
Finally, in tomcatunder directory execution mvn eclipse:eclipsecreate Eclipse Project and import it.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Tomcat source Parsing (a) Download the source code and import eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.