第一步:下载apache-tomcat-6.0.41-src

第二步:阅读BUILDING.txt。了解所需要的步骤。

In order to build a binary distribution version of Apache Tomcat from a source distribution, do the following:

(0) Download and Install a Java Development Kit

因为tomcat依赖于apache dbcp 源码进行编译,而dbcp依赖于JDBC规范,而不同的jdk之间JDBC规范定义的接口可能有出入。所以,这里推荐使用jdk1.5。

(1) Install Apache Ant 1.6.x on your computer

(2) Building Tomcat 6.0

(2.1) Checkout or obtain the source code for Tomcat 6.0

* Tomcat 6.0 SVN repository URL: http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/

(2.2) Building

* Go to that directory, and do:

cd ${tomcat.source}
ant download
ant

(3) Updating sources

It is recommended that you regularly update the downloaded Tomcat 6 sources using your SVN client.

(4) Rebuilds

For a quick rebuild of only modified code you can use:

cd ${tomcat.source}
ant

(5) Building the servlet and jsp API documentation

cd ${tomcat.source}
ant -f dist.xml dist-javadoc

(6) Building the extras (commons-logging, webservices etc.).

cd ${tomcat.source}
ant -f extras.xml

(7) Building a release:

cd ${tomcat.source}
ant -f dist.xml release

第三步:准备工作,安装配置JDK/ANT。

C:\Users\wsc>echo %java_home%
D:\wsc\Program Files (x86)\Java\jdk1.5.0_22 C:\Users\wsc>echo %ant_home%
D:\wsc\software\apache-ant-1.6.5-bin C:\Users\wsc>

第四步:按照tortoise SVN,check out code。

D:\wsc\software\tomcat6.0.x>dir
驱动器 D 中的卷是 新加卷
卷的序列号是 D035-1040 D:\wsc\software\tomcat6.0.x 的目录 2014/06/28 10:47 <DIR> .
2014/06/28 10:47 <DIR> ..
2014/06/28 10:36 1,136 .gitignore
2014/06/28 10:36 <DIR> bin
2014/06/28 10:36 8,880 build.properties.default
2014/06/28 10:36 36,756 build.xml
2014/06/28 10:36 6,215 BUILDING.txt
2014/06/28 10:36 <DIR> conf
2014/06/28 10:36 30,737 dist.xml
2014/06/28 10:36 1,551 eclipse.classpath
2014/06/28 10:36 1,191 eclipse.project
2014/06/28 10:36 16,763 extras.xml
2014/06/28 10:36 <DIR> java
2014/06/28 10:36 32,598 KEYS
2014/06/28 10:36 57,695 LICENSE
2014/06/28 10:36 783 NOTICE
2014/06/28 11:20 <DIR> output
2014/06/28 10:36 9,363 RELEASE-NOTES
2014/06/28 10:36 2,385 RELEASE-PLAN-6.0.txt
2014/06/28 10:36 <DIR> res
2014/06/28 10:36 16,861 RUNNING.txt
2014/06/28 10:36 2,764 STATUS.txt
2014/06/28 10:36 <DIR> test
2014/06/28 10:36 <DIR> webapps
15 个文件 225,678 字节
9 个目录 773,780,836,352 可用字节

第五步:在tomcat6.0.x(x表示开发6.0版本下的最新版本)运行ant download,下载所需要的jar包依赖,第一次下载可能需要几分钟。

D:\wsc\software\tomcat6.0.x>ant download
Buildfile: build.xml build-manifests:
[copy] Copying 10 files to D:\wsc\software\tomcat6.0.x\output\manifests download: testexist:
[echo] Testing for /usr/share/java/tomcat-native-1.1.30/tomcat-native.tar.gz downloadfile-2: testexist:
[echo] Testing for /usr/share/java/tomcat-native-1.1.30/LICENSE downloadzip-2: proxyflags: setproxy: testexist:
[echo] Testing for /usr/share/java/commons-daemon-1.0.15/commons-daemon-1.0.15.jar downloadgz-2: testexist:
[echo] Testing for /usr/share/java/commons-daemon-1.0.15/commons-daemon-1.0.15-native-src.tar.gz downloadfile-2: testexist:
[echo] Testing for /usr/share/java/commons-daemon-1.0.15/windows/prunmgr.exe downloadzip-2: proxyflags: setproxy: testexist:
[echo] Testing for /usr/share/java/commons-pool-1.5.7-src/build.xml downloadgz-2: proxyflags: setproxy: testexist:
[echo] Testing for /usr/share/java/commons-dbcp-1.3-src/build.xml downloadgz-2: build-manifests:
[copy] Copying 10 files to D:\wsc\software\tomcat6.0.x\output\manifests build-tomcat-dbcp:
[copy] Copying 64 files to D:\usr\share\java\tomcat6-deps\dbcp
[move] Moving 64 files to D:\usr\share\java\tomcat6-deps\dbcp\src\java\org\apache\tomcat\dbcp
[javac] Compiling 64 source files to \usr\share\java\tomcat6-deps\dbcp\classes
[javac] 注意:某些输入文件使用或覆盖了已过时的 API。
[javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
[javac] 注意:某些输入文件使用了未经检查或不安全的操作。
[javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
[jar] Building jar: D:\usr\share\java\tomcat6-deps\dbcp\tomcat-dbcp.jar testexist:
[echo] Testing for /usr/share/java/ecj-4.3.1/ecj-4.3.1.jar downloadfile-2: proxyflags: setproxy: testexist:
[echo] Testing for /usr/share/java/nsis-2.46/makensis.exe downloadzip: BUILD SUCCESSFUL
Total time: 3 seconds

在windows下默认的依赖jar的保存路径为:

D:\usr\share\java>dir
驱动器 D 中的卷是 新加卷
卷的序列号是 D035-1040 D:\usr\share\java 的目录 2014/06/28 11:19 <DIR> .
2014/06/28 11:19 <DIR> ..
2014/06/28 11:19 <DIR> avalon-framework-4.1.3
2014/06/28 10:52 <DIR> commons-daemon-1.0.15
2014/06/28 10:52 <DIR> commons-dbcp-1.3-src
2014/06/28 11:19 <DIR> commons-logging-1.1.1
2014/06/28 10:52 <DIR> commons-pool-1.5.7-src
2014/06/28 10:52 <DIR> ecj-4.3.1
2014/06/28 11:19 <DIR> jaxrpc-1.1-rc4
2014/06/28 11:19 <DIR> log4j-1.2.12
2014/06/28 11:19 <DIR> logkit-1.0.1
2014/06/28 10:55 <DIR> nsis-2.46
2014/06/28 11:19 <DIR> servletapi-2.3
2014/06/28 10:52 <DIR> tomcat-native-1.1.30
2014/06/28 10:52 <DIR> tomcat6-deps
2014/06/28 11:19 <DIR> wsdl4j-1.6.1
0 个文件 0 字节
16 个目录 773,780,312,064 可用字节

第六步:运行ant命令。

结果如下:

D:\wsc\software\tomcat6.0.x>ant
Buildfile: build.xml build-prepare:
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\classes
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\bin
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\conf
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\lib
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\logs
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\temp
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\webapps compile:
[javac] Compiling 1090 source files to D:\wsc\software\tomcat6.0.x\output\classes
[javac] 注意:某些输入文件使用或覆盖了已过时的 API。
[javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
[javac] 注意:某些输入文件使用了未经检查或不安全的操作。
[javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
[copy] Copying 182 files to D:\wsc\software\tomcat6.0.x\output\classes
[copy] Copying 6 files to D:\wsc\software\tomcat6.0.x\output\classes\javax\servlet\resources build-manifests:
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\manifests
[copy] Copying 10 files to D:\wsc\software\tomcat6.0.x\output\manifests package:
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\annotations-api.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\servlet-api.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\jsp-api.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\el-api.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\bin\bootstrap.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\bin\tomcat-juli.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\catalina.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\catalina-tribes.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\catalina-ha.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\catalina-ant.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\tomcat-coyote.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\jasper.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\jasper-el.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\tomcat-i18n-es.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\tomcat-i18n-fr.jar
[jar] Building jar: D:\wsc\software\tomcat6.0.x\output\build\lib\tomcat-i18n-ja.jar build-only: build-docs:
[copy] Copying 27 files to D:\wsc\software\tomcat6.0.x\output\build\webapps
[copy] Copying 2 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\sample
[mkdir] Created dir: D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\aio.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\aio.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\apr.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\apr.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\balancer-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\balancer-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\building.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\building.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\cgi-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\cgi-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\changelog.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\changelog.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\class-loader-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\class-loader-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\cluster-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\cluster-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\connectors.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\connectors.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\default-servlet.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\default-servlet.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\deployer-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\deployer-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\developers.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\developers.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\extras.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\extras.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\html-manager-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\html-manager-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\index.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\index.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\introduction.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\introduction.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\jasper-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\jasper-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\jndi-datasource-examples-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\jndi-datasource-examples-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\jndi-resources-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\jndi-resources-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\logging.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\logging.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\manager-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\manager-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\maven-jars.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\maven-jars.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\mbeans-descriptor-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\mbeans-descriptor-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\monitoring.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\monitoring.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\proxy-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\proxy-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\realm-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\realm-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\security-manager-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\security-manager-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\setup.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\setup.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\ssi-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\ssi-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\ssl-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\ssl-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\virtual-hosting-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\virtual-hosting-howto.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\windows-service-howto.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\windows-service-howto.html
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\deployment.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\deployment.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\index.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\index.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\installation.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\installation.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\introduction.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\introduction.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\processes.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\processes.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\appdev\source.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\appdev\source.html
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-admin-apps.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-admin-apps.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-admin-objects.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-admin-objects.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-admin-opers.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-admin-opers.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-default.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-default.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-invoker.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-invoker.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-jdbc-realm.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-jdbc-realm.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-jndi-realm.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-jndi-realm.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\fs-memory-realm.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\fs-memory-realm.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\index.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\index.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\funcspecs\mbean-names.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\funcspecs\mbean-names.html
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\ajp.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\ajp.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-channel.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-channel.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-deployer.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-deployer.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-interceptor.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-interceptor.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-listener.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-listener.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-manager.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-manager.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-membership.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-membership.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-receiver.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-receiver.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-sender.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-sender.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster-valve.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster-valve.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\cluster.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\cluster.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\context.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\context.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\engine.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\engine.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\executor.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\executor.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\filter.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\filter.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\globalresources.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\globalresources.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\host.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\host.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\http.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\http.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\index.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\index.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\listeners.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\listeners.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\loader.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\loader.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\manager.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\manager.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\realm.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\realm.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\resources.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\resources.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\server.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\server.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\service.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\service.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\systemprops.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\systemprops.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\config\valve.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\config\valve.html
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\architecture
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\architecture\index.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\architecture\index.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\architecture\overview.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\architecture\overview.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\architecture\requestProcess.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\architecture\requestProcess.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\architecture\startup.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\architecture\startup.html
[xslt] Transforming into D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\developers.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\developers.html
[xslt] Loading stylesheet D:\wsc\software\tomcat6.0.x\webapps\docs\tomcat-docs.xsl
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\faq.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\faq.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\interceptors.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\interceptors.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\introduction.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\introduction.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\membership.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\membership.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\setup.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\setup.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\status.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\status.html
[xslt] Processing D:\wsc\software\tomcat6.0.x\webapps\docs\tribes\transport.xml to D:\wsc\software\tomcat6.0.x\output\build\webapps\docs\tribes\transport.html warn.dbcp: deploy:
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\bin
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\bin
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\bin
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\bin
[copy] Copying 17 files to D:\wsc\software\tomcat6.0.x\output\build\bin
[copy] Copying 7 files to D:\wsc\software\tomcat6.0.x\output\build\conf
[copy] Copying 208 files to D:\wsc\software\tomcat6.0.x\output\build\webapps
[copy] Copying 2 files to D:\wsc\software\tomcat6.0.x\output\build\webapps
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\ROOT
[javac] Compiling 43 source files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\WEB-INF\classes
[javac] 注意:D:\wsc\software\tomcat6.0.x\webapps\examples\WEB-INF\classes\compressionFilters\CompressionServletResponseWrapper.java 使用或覆盖了已过时的 API。
[javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
[javac] 注意:某些输入文件使用了未经检查或不安全的操作。
[javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
[javac] Compiling 1 source file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\plugin\applet
[txt2html] Converted 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\simpletag
[txt2html] Converted 4 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\simpletag
[txt2html] Converted 5 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\simpletag
[txt2html] Converted 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\jspattribute
[txt2html] Converted 4 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\jspattribute
[txt2html] Converted 4 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\cal
[txt2html] Converted 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsptoserv
[txt2html] Converted 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\el
[txt2html] Converted 1 file to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\misc
[txt2html] Converted 4 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples\jsp\jsp2\tagfiles
[txt2html] Converted 47 files to D:\wsc\software\tomcat6.0.x\output\build\webapps\examples
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\lib
[copy] Copying 1 file to D:\wsc\software\tomcat6.0.x\output\build\lib BUILD SUCCESSFUL
Total time: 12 seconds
D:\wsc\software\tomcat6.0.x>

第七步:测试。

在目录D:\wsc\software\tomcat6.0.x\output\build\bin下面,运行startup.bat,正常启动。

第八步:修改tomcat源码,再build,查看效果。

修改D:\wsc\software\tomcat6.0.x\java\org\apache\catalina\startup\Bootstrap.java文件的main方法如下:

    public static void main(String args[]) {
//add start by wsc( 2014.06.28)
System.out.println(new java.util.Date());
System.out.println("==============================================================================");
for(String s : args) {
System.out.println(s);
}
System.out.println("==============================================================================");
System.out.println("==============================================================================");
System.out.println("==============================================================================");
//add end by wsc( 2014.06.28) if (daemon == null) {
daemon = new Bootstrap();
try {
daemon.init();
} catch (Throwable t) {
t.printStackTrace();
return;
}
}

运行ant命令重新编译...

运行startup.bat的控制台输出如下:

运行shutdown.bat输出如下:

D:\wsc\software\tomcat6.0.x\output\build\bin>shutdown.bat
Using CATALINA_BASE: "D:\wsc\software\tomcat6.0.x\output\build"
Using CATALINA_HOME: "D:\wsc\software\tomcat6.0.x\output\build"
Using CATALINA_TMPDIR: "D:\wsc\software\tomcat6.0.x\output\build\temp"
Using JRE_HOME: "D:\wsc\Program Files (x86)\Java\jdk1.5.0_22"
Using CLASSPATH: "D:\wsc\software\tomcat6.0.x\output\build\bin\bootstrap.jar"
Sat Jun 28 12:52:13 CST 2014
==============================================================================
stop
==============================================================================
==============================================================================
==============================================================================

自己动手编译apache-tomcat-6.0.41-src源码的更多相关文章

  1. 如何编译Apache Hadoop2.6.0源代码

    如何编译Apache Hadoop2.6.0源代码 1.安装CentOS 我使用的是CentOS6.5,下载地址是http://mirror.neu.edu.cn/centos/6.5/isos/x8 ...

  2. Target runtime Apache Tomcat v6.0 is not defined

    在工程目录下的.settings文件夹里,打开org.eclipse.wst.common.project.facet.core.xml文件,其内容是: <?xml version=" ...

  3. Target runtime Apache Tomcat v7.0 is not defined.

    打开项目,找到.settings--->org.eclipse.wst.common.project.facet.core 修改这个文件中: <?xml version="1.0 ...

  4. Java compiler level does not match the version of the installed Java project facet. springmvc1 和 Target runtime Apache Tomcat v7.0 is not defined.

    Java compiler level does not match the version of the installed Java project facet.springmvc1 : Targ ...

  5. Target runtime Apache Tomcat v6.0 is not defined. phyy Unknown Faceted Project Problem

    Description Resource Path Location TypeTarget runtime Apache Tomcat v6.0 is not defined. phyy Unknow ...

  6. 【甘道夫】Win7x64环境下编译Apache Hadoop2.2.0的Eclipse小工具

    目标: 编译Apache Hadoop2.2.0在win7x64环境下的Eclipse插件 环境: win7x64家庭普通版 eclipse-jee-kepler-SR1-win32-x86_64.z ...

  7. Target runtime Apache Tomcat v8.0 is not defined.

    Target runtime Apache Tomcat v8.0 is not defined. Window-Preference-MyEclipse-Targeted Runtimes,选择存在 ...

  8. 【eclipse】Target runtime Apache Tomcat v7.0 is not defined解决

    在eclipse中导入项目时提示Target runtime Apache Tomcat v7.0 is not defined, 解决方法:右键项目--properties--targeted ru ...

  9. 创建Dynamic Web Project时 显示最新Apache Tomcat 8.0 的方法

    创建Dynamic Web Project时  显示最新Apache Tomcat  8.0 等的方法 解决办法如下: 第一步:eclipse菜单help->eclipse marketplac ...

  10. Server Library [Apache Tomcat 7.0] unbound解决方案

    问题描述: 当在MyEclipse中导入高版本Eclipse的[Eclipse Dynamic Web]项目后,会发现其Java Build Path(选定项目->Alt+Enter即可打开Pr ...

随机推荐

  1. [问题2014S02] 复旦高等代数II(13级)每周一题(第二教学周)

    问题2014S02  设实系数多项式 \begin{eqnarray*}f(x) &=& a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0, \\ g(x) ...

  2. Unity3d 脚本相互调用

    unity中三种调用其他脚本函数的方法 第一种,被调用脚本函数为static类型,调用时直接用  脚本名.函数名().很不实用…… 第二种,GameObject.Find("脚本所在物体名& ...

  3. hdu 5446 Unknown Treasure 卢卡斯+中国剩余定理

    Unknown Treasure Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Other ...

  4. 扩展XAF模型信息实现自定义功能

    如何隐藏 web listview 的 编辑控制列如下图: 这列怎么让它隐藏? 感谢[少侠]XAF_杨东 提供解答!感谢XAF_小学生整理.   A: 注册自定义接口IModelListViewExt ...

  5. JavaScript的一点自我总结

    学习前端不知不觉都两个月了,从零基础到现在,网页布局没多大问题,就是JS学的很差,有一段时间都怀疑自己是不是选错了.但自我调节后,心态发生了一些变化后,学习也没那么痛苦了.虽然做不到看代码像看初恋那样 ...

  6. python成长之路【第三篇】:函数

    1.函数基础 函数是python为了代码最大程度的重用和最小化代码冗余而提供的基本程序结构. 函数是一种设计工具,它能让程序员将复杂的系统分解为可管理的部件. 函数用于将相关功能打包并参数. pyth ...

  7. hdu4987A simple probability problem.(凸包)

    链接 多校的最后一场,当时没看懂题意,看题目还以为是概率问题就没深看. 官方题解 对于他说的第一种,考虑长为L的线段 概率为2L/(pi*d), 可以理解,下面的就不知道在说啥了.. 按我初始的想法想 ...

  8. Asp.Net_单点登录

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  9. java.util.concurrent包分类结构图

    摘自:http://blog.csdn.net/tsyj810883979/article/details/6956290

  10. angularjs简述

    1.MVC设计模式 MVC 是一种使用 MVC(Model View Controller 模型-视图-控制器)设计创建 Web 应用程序的模式 Model(模型)表示应用程序核心(比如数据库记录列表 ...