目录:
/bin 存放脚本文件,包括启动tomcat以及关闭tomcat等功能的bat,sh脚本。
/conf 存放tomcat的xml配置文件和properties配置文件。
/java java源代码放置到这个目录。
/native tomcat的native-connector工程放置的目录,是一个vc60工程。
/res ini文件及其它的一些静态资源文件可以放在res目录,以及生成可执行文件的nsis脚本。
/test 放置测试文件,项目
/webapps 放置tomcat的web工程文件
文件:
/build.properties.default 构建工程的属性文件
/build.xml ant 构建文件
/dist.xml 生成目标的构建文件
/extras.xml 扩展的构建文件
/其他 其他为说明文件 2,如何构建Tomcat6
(0)下载安装jdk1.5或者以上版本,设置JAVA_HOME环境变量指向JDK的安装目录。如果已经安装jdk,跳转到步骤1。
(1)安装apache ant 1.6.x。如果已经安装,请跳转到步骤2.下载apache
http://ant.apache.org/bindownload.cgi 。安装。
*创建ANT_HOME 环境变量,指向ant的安装目录 ${ant.home}.
* 在系统PATH环境变量中添加${ant.home}/bin .
(2)构建 Tomcat 6.0
(2.1)获取 Tomcat 6.0的源代码
* Tomcat SVN repository URL:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/
* Download a source package from:
http://tomcat.apache.org/download-60.cgi
* Checkout the source using SVN, selecting the desired version or
branch (current development source is at
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/), or
unpack the source package. The location where the source has been
placed will be referred as ${tomcat.source}.
(2.2) 构建
* Go to that directory, and do: cd ${tomcat.source}
ant download
ant
* NOTE: Users accessing the Internet through a proxy must use a properties
file to indicate to Ant the proxy configuration. Read below.
* WARNING: Running this command will download binaries to the /usr/share/java
directory. Make sure this is appropriate to do on your computer. On Windows,
this usually corresponds to the "C:\usr\share\java" directory, unless Cygwin
is used. Read below to customize the directory used to download the binaries.
* The build can be controlled by creating a ${tomcat.source}/build.properties
file, and adding the following content to it:
# ----- Proxy setup -----
# Uncomment if using a proxy server
#proxy.host=proxy.domain
#proxy.port=8080
#proxy.use=on
# ----- Default Base Path for Dependent Packages -----
# Replace this path with the directory path where dependencies binaries
# should be downloaded
base.path=/usr/share/java
(3) Updating sources
It is recommended that you regularly update the downloadedTomcat 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
The documentation can be easly built: cd ${tomcat.source}
ant -f dist.xmldist-javadoc
(6) Building the extras (commons-logging, webservices etc.). cd ${tomcat.source}
ant -f extras.xml
(7) Building a release running tests: cd ${tomcat.source}
ant -f dist.xml release 3,build.xml解析
Build.xml是一个标准的ant的构建文件,通过此文件,可以构建tomcat工程。大纲结构如下: