|
Tomcat example source code file (building.xml)
The Tomcat building.xml source code<?xml version="1.0"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document> &project; <properties> <author>Remy Maucherat <title>Building Tomcat </properties> <body> <section name="Introduction"> <p> Building Apache Tomcat from SVN is very easy, and is the first step to contributing to Tomcat. The following is a step by step TODO list. </p> </section> <section name="Download a Java Development Kit (JDK) release (version 1.5.x or later)"> <p> The Sun JDK can be downloaded <a href="http://java.sun.com/j2se/">here. </p> <p> <b>IMPORTANT: Set an environment variable JAVA_HOME to the pathname of the directory into which you installed the JDK release. </p> </section> <section name="Install Apache Ant 1.6.5 or later"> <p> Download a binary distribution of Ant 1.6.5 or later from <a href="http://ant.apache.org/bindownload.cgi">here. </p> <p> Unpack the binary distribution into a convenient location so that the Ant release resides in its own directory (conventionally named "apache-ant-1.6.x"). For the purposes of the remainder of this document, the symbolic name "${ant.home}" is used to refer to the full pathname of the release directory. </p> <p> Create an ANT_HOME environment variable to point the directory ${ant.home}, and modify the PATH environment variable to include directory "${ant.home}/bin" in its list. This makes the "ant" command line script available, which will be used to actually perform the build. </p> </section> <section name="Checkout or obtain the source code for Tomcat 6.0"> <p> Tomcat SVN repository URL: <code>http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ </p> <p> Download a source package from: <code>http://tomcat.apache.org/download-60.cgi </p> <p> Checkout the source using SVN, selecting the desired version or branch (current development source is at <code>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}. </p> </section> <section name="Building Tomcat"> <p> Use the following commands: <code> | ANT_HOME | the base path of Ant 1.6.2 or later | </table> </p> <p> Use File->New Project to create a new Java project for each of the binaries repository (e.g., /usr/share/java), container, connectors, jasper, servletapi. Unless you thought ahead to make the ${tomcat.source} directory be under your Workspace folder, tell Eclipse the external location using "Import/Export...", General->Existing Project into Workspace. </p> <p> Eclipse .project and .classpath files are provided in each of these directories so Eclipse should find all source trees and jars, and hopefully compile without problems. <b>Note that these files assume you are using Eclipse with a 5.0 or later JDK; also, the connectors module must be built with a compiler compliance level of 5.0. </p> <p> To run Tomcat without a special IDE plug-in, you can simply use Run->Run... enter "org.apache.catalina.startup.Catalina" as the main class, "start" as program arguments, and "-Dcatalina.home=..." (with the name of your build directory) as VM arguments. </p> <p> Note also that due to the way the Tomcat source is assembled from several SVN projects, you may not be able to use the Eclipse SVN client to update (nor to commit, if you are a committer). Use the external SVN client of your choice, then use the Eclipse PackageExplorer or Navigator "Refresh" context menu item to tell Eclipse that you've updated the files. </p> </section> <section name="Building with other IDEs"> <p> The same caveats apply as for Eclipse, above. </p> <p> The same general idea should work in most IDEs; it has been reported to work in Idea, for example. </p> </section> </body> </document>
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.