第一步:下载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. DOM,BOM

    1.DOM:文档对象模型(Document Object Model) 1)子节点:只是这一代的后代,不会计算后代的后代  1.childNodes:获取子节点,    --IE6-8:获取的是元素节 ...

  2. ViewPager With FragmentPagerAdapter

    采用PagerAdapter中的FragmentPagerAdapter来实现页面切换,适用于a handful of typically more static fragments to be pa ...

  3. hdu 5779 Tower Defence

    题意:考虑由$n$个结点构成的无向图,每条边的长度均为$1$,问有多少种构图方法使得结点$1$与任意其它节点之间的最短距离均不等于$k$(无法到达时距离等于无穷大),输出答案对$1e9+7$取模.$1 ...

  4. AtCoder Beginner Contest 050 ABC题

    A - Addition and Subtraction Easy Time limit : 2sec / Memory limit : 256MB Score : 100 points Proble ...

  5. Java开发中经典的小实例-(用*打印图案)

    public class Test19 {    public static void main(String[] args) {        // TODO Auto-generated meth ...

  6. 正则表达式获取TABLE里的内容

    //过滤\n 转换成空            String withoutNString=message.Replace("\n", "");          ...

  7. sbrk与brk的使用小例子

    sbrk() 和 brk() - Unix的系统函数   sbrk()和brk() 系统的底层会维护一个位置,通过位置的移动完成内存的分配和回收.映射内存时 以一个内存页作为基本单位.   void* ...

  8. collectionView布局原理及瀑布流布局方式

    一直以来都想研究瀑布流的具体实现方法(起因是因为一则男女程序员应聘的笑话,做程序的朋友应该都知道).最近学习到了瀑布流的实现方法,瀑布流的实现方式有多种,这里应用collectionView来重写其U ...

  9. hdu2896病毒侵袭(ac自动机)

    链接 ac自动机的模板题 说2个注意的地方 一是题目说明包含所有ASCII字符,可以开到0-127 包含空格 题目会输入多个源串,在加完当前的val值时,不应清0,可以开个标记数组. #include ...

  10. ASP.NET 程序中删除文件夹导致session失效解决问题

    在Global中  Application_Start 添加 如: void Application_Start(object sender, EventArgs e)    {        //在 ...