Monday, November 2, 2009

9.2 Obtaining the Source








 

 












9.2 Obtaining the Source





Since Tomcat is a moving target (each

release changes slightly, and point releases happen fairly

frequently), this is only a general description of the build process.







9.2.1 Downloading Source Code





If you want a simpler start, you can get a release source TAR for

Tomcat 4 from the Jakarta Tomcat 4 releases directory at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release.

Choose a release, navigate into that release's

src/ directory, download the compressed archives

of the source code, and unpack them all in a directory where you want

to build it.









9.2.2 Obtaining Source Code with CVS





If you are very brave and like to

live on the edge, you can update your source tree periodically

between point releases and help the Tomcat development team test out

new features that are in development. To do this you must use the

Concurrent Versions System (CVS); see the CVS Pocket

Reference
, by Gregor N. Purdy (O'Reilly)

for details.





If you want to use CVS, the Tomcat CVS modules are

jakarta-tomcat-4.0 (even for Tomcat 4.1!),

jakarta-tomcat-jasper, and

jakarta-tomcat-connectors.

















If you don't have CVS installed, get it from

http://www.cvshome.org/. Like

Tomcat, CVS is free software; anybody can use it without having to

pay a fee.







Starting in a clean directory or your normal source directory, log

into CVS as the anonymous user:





$ cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login

Password: anoncvs




In order to pull a copy of the Tomcat 4 source code, you should

request a specific version by referring to its version tag in CVS. If

you pull the source without specifying a tag, what

you'll get is an untagged (and potentially untested)

copy of the source, and it may not build.















Always be sure to specify a version tag; this is one of the most

common causes for a broken build.







You can see a

list of tags by viewing the revision history of the

LICENSE file at http://cvs.apache.org/viewcvs/jakarta-tomcat-4.0/LICENSE.

For example, if you want to pull a copy of the Tomcat 4.1.24 source,

use these tags:





$ cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic checkout -r TOMCAT_4_1_24 \

jakarta-tomcat-4.0 jakarta-tomcat-jasper jakarta-tomcat-connectors




Pulling all of the source will probably take a little while, but when

CVS is done transferring, you'll have all three

source directories, straight out of the source code repository.





Once you have the code, the jakarta-tomcat-4.0,

jakarta-tomcat-jasper, and

jakarta-tomcat-connectors directories all reside

within the same base directory. You can place these directories in

other places, but if you do, you must edit the

jakarta-tomcat-4.0/build.properties file (if it

doesn't yet exist, copy

build.properties.sample to

build.properties) and change these lines:





# ----- Jakarta Tomcat Connectors source path -----

#jtc.home=../../jakarta-tomcat-connectors





# ----- Jakarta Tomcat Jasper source path -----

#jasper.home=../jakarta-tomcat-jasper/jasper2


All of these directories reside within the same base directory by

default, so you do not need to modify these

lines if this is your setup.


















     

     


    No comments: