Professional Documents
Culture Documents
BUILDINGaaaaaapaaaaciiiii
BUILDINGaaaaaapaaaaciiiii
======
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for afasdfasdfasdfdditional 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
sdfasdfasd
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.
================================================================================
==asdf==================================================
Building The Apache Tomcat 9.0 Servlet/JSP Container
====================================================
This subproject contains the source code for Tomcat 9.0, a container that
implements the Servlet 4.0, JSP 2.3, EL 3.0, WebSocket 1.1 and JASPIC 1.1
specifications from the Java Community Process <https://www.jcp.org/>.
Note: If you just need to run Apache Tomcat, it is not necessary to build
it. You may asdfsimply download a binary distribution. It is cross-platform.
Read RUNNING.txt for the instruction on how to run it.
The location where the source has been placed will be further referred as
${tomcat.source}.
The Tomcat local build process does not modify line-endings. The svn repository
is configured so that all files will be checked out with the line-ending
appropriate for the current platform. When using a source package you should
ensure that you use the source package that has the appropriate line-ending
for your platform:
Note that the release build process does modify line-endings to ensure that
each release package has the appropriate line-endings.
(3.2) Building
* NOTE: The default value of the base.path property configures the build script
to download the libraries required to build Tomcat to the
${user.home}/tomcat-build-libs directory.
* NOTE: Users accessing the Internet through a proxy must use the properties
file to indicate to Ant the proxy configuration.
proxy.use=true
proxy.host=proxy.domain
proxy.port=8080
proxy.user=username
proxy.password=password
See Apache Ant documentation for the <setproxy> task for details.
cd ${tomcat.source}
ant
Note that the build includes Tomcat documentation, which can be found
in the output/build/webapps/docs directory.
* NOTE: Do not run the build as the root user. Building and running Tomcat
does not require root privileges.
There are several targets in Tomcat build files that are useful to be
called separately. They build components that you may want to build
quickly, or ones that are included in the full release and are not built
during the default "deploy" build.
cd ${tomcat.source}
ant build-docs
output/build/webapps/docs
cd ${tomcat.source}
ant javadoc
output/dist/webapps/docs/api
output/dist/webapps/docs/elapi
output/dist/webapps/docs/jspapi
output/dist/webapps/docs/servletapi
cd ${tomcat.source}
ant extras
cd ${tomcat.source}
ant embed
(6) Building a full release (as provided via the ASF download pages)
You will be prompted for the GPG passphrase when the release build
starts, unless "gpg.passphrase" property is set.
ASF committers performing official releases will need to configure the code
signing service so that the Windows installer is signed during the build
process. The following properties need to be added to the build.properties
file:
Release managers will be provided with the necessary credentials by the PMC.
cd ${tomcat.source}
ant release
(7) Tests
(7.1) Running Tomcat tests
Tomcat includes a number of junit tests. The tests are not run when a
release is built. There is separate command to run them.
cd ${tomcat.source}
ant test
The JUnit reports generated by the tests will be written to the following
directory:
output/build/logs
execute.test.nio=true
execute.test.nio2=true
execute.test.apr=true
The APR connector can be tested only if Tomcat-Native library binaries are
found by the testsuite. The "test.apr.loc" property specifies the directory
where the library binaries are located.
output/build/bin/native/
If you are on Windows and want to test the APR connector you can put the
tcnative-1.dll file into ${tomcat.source}/bin/native/ and it will be copied
into the above directory when the build runs.
The unit tests include tests of the clustering functionality which require
multicast to be enabled. There is a simple application provided in the Tomcat
test source (org.apache.catalina.tribes.TesterMulticast) that can be used to
check if a machine supports multicast. Notes on enabling multicast for different
operating systems are provided in the Javadoc for that class.
For example:
test.entry=org.apache.catalina.util.TestServerInfo
It is possible to further limit such run to a number of selected test
methods by adding "test.entry.methods" property. The property specifies a
comma-separated list of test case methods.
For example:
test.entry=org.apache.el.lang.TestELArithmetic
test.entry.methods=testMultiply01,testMultiply02
You can include multiple patterns by concatenating them with a comma (",")
as the separator.
For example:
test.name=**/TestSsl.java,**/TestWebSocketFrameClientSSL.java
You can exclude specific JUnit test classes by adding the "test.exclude"
property to the build.properties file. The property specifies an Ant
excludes pattern for the fileset of test class files to exclude form the run.
The default value is empty, so no classes are excluded. The syntax is the same
as for the property "test.name".
output/build/logs
test.accesslog=true
output/build/logs
The log files will be written to the temporary directory used by the
tests,
output/test-tmp/logs
4. It is possible to configure formatter used by JUnit reports.
Configuration properties are "junit.formatter.type",
"junit.formatter.extension" and "junit.formatter.usefile".
junit.formatter.usefile=false
test.cobertura=true
test.threads=1
output/coverage
7. The performance tests are written to run reasonably powerful machines (such
as a developer may use day to day) assuming no other resource hungry
processes are running.
test.excludePerformance=true
8. Some tests include checks that the access log valve entries are as expected.
These checks include timings. On slower / loaded systems these checks will
often fail. The checks may be relaxed by using the following property:
test.relaxTiming=true
java.net.preferIPv4Stack=true
test.verbose=true
(8.1) Checkstyle
Tomcat comes with a Checkstyle configuration that tests its source code
for certain conventions, like presence of the license header.
execute.validate=true
output/res/checkstyle
cd ${tomcat.source}
ant -Dexecute.validate=true validate
(8.2) FindBugs
NOTE: FindBugs is licensed under LGPL. Using Findbugs during Tomcat build is
optional and is off by default.
execute.findbugs=true
cd ${tomcat.source}
ant -Dexecute.findbugs=true findbugs
output/findbugs
Apache Tomcat project has convention that all of its textual source files,
stored in the Git repository, use Unix style LF line endings.
This test is used by developers to check that the source code adheres to
this convention. It verifies that the ends of lines in textual files are
appropriate. The idea is to run this check regularly and notify developers
when an inconsistency is detected.
cd ${tomcat.source}
ant validate-eoln