alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Tomcat example source code file (extras.xml)

This example Tomcat source code file (extras.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Tomcat tags/keywords

apache, asf, classpath, download, javadoc, javadoc, license, license, localstrings_, localstrings_, see, see, tomcat, you

The Tomcat extras.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.
-->
<project name="Tomcat 6.0" default="extras" basedir=".">


  <!-- ===================== Initialize Property Values =================== -->

  <!-- See "build.properties.sample" in the top level directory for all     -->
  <!-- property values you must customize for successful building!!!        -->
  <property file="${user.home}/build.properties"/>
  <property file="build.properties"/>

  <property file="build.properties.default"/>

  <!-- Project Properties -->
  <property name="name"                  value="Apache Tomcat" />
  <property name="year"                  value="2007" />
  <property name="version.major"         value="6" />
  <property name="version.minor"         value="0" />
  <property name="version.build"         value="0" />
  <property name="version.patch"         value="0" />
  <property name="version"               value="6.0.0-dev" />
  <property name="version.number"        value="${version.major}.${version.minor}.${version.build}.${version.patch}" />

  <property name="project"               value="apache-tomcat" />
  <property name="final.name"            value="${project}-${version}" />
  <property name="final-src.name"        value="${project}-${version}-src" />

  <!-- Build Defaults -->
  <property name="tomcat.build"      value="${basedir}/output/build"/>
  <property name="tomcat.classes"    value="${basedir}/output/classes"/>
  <property name="tomcat.dist"       value="${basedir}/output/dist"/>
  <property name="tomcat.extras"     value="${basedir}/output/extras"/>
  <property name="tomcat.deployer"   value="${basedir}/output/deployer"/>
  <property name="tomcat.release"    value="${basedir}/output/release"/>
  <property name="test.failonerror"  value="true"/>
  <property name="test.runner"       value="junit.textui.TestRunner"/>

  <!-- Can't be lower - jsp uses templates -->
  <property name="compile.source" value="1.5"/>

  <!-- JAR artifacts -->
  <property name="bootstrap.jar" value="${tomcat.build}/bin/bootstrap.jar"/>

  <property name="annotations-api.jar" value="${tomcat.build}/lib/annotations-api.jar"/>
  <property name="servlet-api.jar" value="${tomcat.build}/lib/servlet-api.jar"/>
  <property name="jsp-api.jar" value="${tomcat.build}/lib/jsp-api.jar"/>
  <property name="el-api.jar" value="${tomcat.build}/lib/el-api.jar"/>
  <property name="catalina.jar" value="${tomcat.build}/lib/catalina.jar"/>
  <property name="catalina-ant.jar" value="${tomcat.build}/lib/catalina-ant.jar"/>
  <property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>

  <property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
  <property name="jasper-el.jar" value="${tomcat.build}/lib/jasper-el.jar"/>

  <property name="tomcat-dbcp.home" value="${base.path}/tomcat6-deps/dbcp" />
  <property name="jasper-jdt.home" value="${base.path}/tomcat6-deps/jdt" />
  <property name="tomcat-dbcp.jar" value="${tomcat-dbcp.home}/tomcat-dbcp.jar"/>
  <property name="jasper-jdt.jar" value="${jasper-jdt.home}/jasper-jdt.jar"/>

  <property name="tomcat-juli.jar" value="${tomcat.extras}/tomcat-juli.jar"/>
  <property name="tomcat-juli-adapters.jar" value="${tomcat.extras}/tomcat-juli-adapters.jar"/>
  <property name="catalina-ws.jar" value="${tomcat.extras}/catalina-ws.jar"/>
	
  <!-- Classpath -->
  <path id="tomcat.classpath">
    <pathelement location="${tomcat.classes}"/>
  </path>

  <target name="prepare">
    <mkdir dir="${tomcat.extras}"/>
  </target>

  <target name="clean">
  	<delete dir="${tomcat.extras}"/>
  </target>

  <target name="commons-logging">
    
    <antcall target="downloadfile">
      <param name="sourcefile" value="${commons-logging-src.loc}"/>
      <param name="destfile" value="${tomcat.extras}/logging/commons-logging-src.tar.gz"/>
      <param name="destdir" value="${tomcat.extras}/logging/"/>
    </antcall>
    <gunzip src="${tomcat.extras}/logging/commons-logging-src.tar.gz" 
    	dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
    <untar src="${tomcat.extras}/logging/commons-logging-src.tar" 
    	dest="${tomcat.extras}/logging/"/>
  	
    <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/commons" >
      <replacefilter token="org.apache.commons"
            value="org.apache.juli" />
    </replace>
    <mkdir dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/juli" />
    <move todir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/juli">
      <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/commons" />
    </move>

    <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src" >
      <replacefilter token="org.apache.commons"
            value="org.apache.juli" />
        <replacefilter token="org/apache/commons/"
              value="org/apache/juli/" />
    </replace>
    <copy tofile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml" 
    	file="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build.xml" />

  	<ant antfile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml"
  	     dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src" 
  	     target="getlibs" />
    <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src">
      <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/lib" />
    </copy>
  	<ant antfile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml"
  	     dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src"
  	     target="compile" />
  
    <jar jarfile="${tomcat-juli.jar}">
      <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/target/classes">
        <include name="org/apache/juli/logging/*.class" /> 
        <include name="org/apache/juli/logging/impl/LogFactoryImpl*.class" /> 
        <include name="org/apache/juli/logging/impl/WeakHashtable*.class" /> 
        <include name="org/apache/juli/logging/impl/SimpleLog*.class" /> 
        <include name="org/apache/juli/logging/impl/NoOpLog*.class" /> 
        <include name="org/apache/juli/logging/impl/Jdk14Logger.class" /> 
        <include name="META-INF/LICENSE.txt" /> 
        <include name="META-INF/NOTICE.txt" /> 
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/juli/*" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>
    <checksum file="${tomcat-juli.jar}"
              forceOverwrite="yes" fileext=".md5" />

    <jar jarfile="${tomcat-juli-adapters.jar}">
      <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/target/classes">
        <include name="org/apache/juli/logging/impl/**.class" /> 
        <exclude name="org/apache/juli/logging/impl/WeakHashtable*.class" /> 
        <exclude name="org/apache/juli/logging/impl/LogFactoryImpl.class" /> 
        <include name="META-INF/LICENSE.txt" /> 
        <include name="META-INF/NOTICE.txt" /> 
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>
    <checksum file="${tomcat-juli-adapters.jar}"
              forceOverwrite="yes" fileext=".md5" />

  </target>

  <target name="webservices">
	
	    <mkdir dir="${tomcat.extras}/webservices"/>
	
	    <antcall target="downloadfile">
	      <param name="sourcefile" value="${jaxrpc-src.loc}"/>
	      <param name="destfile" value="${tomcat.extras}/webservices/jaxrpc.jar"/>
	      <param name="destdir" value="${tomcat.extras}/webservices/"/>
	    </antcall>
	
	    <antcall target="downloadfile">
	      <param name="sourcefile" value="${wsdl4j-src.loc}"/>
	      <param name="destfile" value="${tomcat.extras}/webservices/wsdl4j.jar"/>
	      <param name="destdir" value="${tomcat.extras}/webservices/"/>
	    </antcall>
	
	    <!-- Classpath -->
	    <path id="tomcat.webservices.classpath">
	      <pathelement path="${tomcat.classpath}"/>
	      <fileset dir="${tomcat.extras}/webservices">
	        <include name="jaxrpc.jar"/>
	        <include name="wsdl4j.jar"/>
	      </fileset>
	    </path>
	
	    <!-- Compile internal server components -->
	    <javac srcdir="java" destdir="${tomcat.classes}"
	           debug="${compile.debug}"
	           deprecation="${compile.deprecation}"
	           source="${compile.source}"
	           optimize="${compile.optimize}">
	      <classpath refid="tomcat.webservices.classpath" />
	      <include name="org/apache/naming/factory/webservices/**" />
	    </javac>
	
	    <!-- Catalina Main JAR File -->
	    <jar jarfile="${catalina-ws.jar}">
	      <fileset dir="${tomcat.classes}">
            <include name="org/apache/naming/factory/webservices/**" />
	        <!-- Javadoc and i18n exclusions -->
	        <exclude name="**/package.html" />
	        <exclude name="**/LocalStrings_*" />
	      </fileset>
	    </jar>
        <checksum file="${catalina-ws.jar}"
              forceOverwrite="yes" fileext=".md5" />
	
  </target>

  <target name="extras" depends="prepare,commons-logging,webservices">
  </target>

  <!-- Download and dependency building -->
  <target name="proxyflags">
    <!-- check proxy parameters. -->
    <condition property="useproxy">
      <equals arg1="${proxy.use}" arg2="on" />
    </condition>
  </target>

  <target name="setproxy" depends="proxyflags" if="useproxy">
    <taskdef name="setproxy"
            classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
              proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
    <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
  </target>

  <target name="testexist">
    <echo message="Testing  for ${destfile}"/>
    <available file="${destfile}" property="exist"/>
  </target>

  <target name="downloadfile" unless="exist" depends="setproxy,testexist">
    <!-- Download extract the file -->
    <mkdir dir="${destdir}" />
    <get src="${sourcefile}" dest="${destfile}" />
  </target>

</project>

Other Tomcat examples (source code examples)

Here is a short list of links related to this Tomcat extras.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.