I had some trouble, mainly with security exception. The following worked fine
though:
========================================================================================================================
build.properties:
========================================================================================================================
# -----------------------------------------------------------------------------
# build.properties.sample
#
# This is an example "build.properties" file, used to customize building Struts
# for your local environment. Make any changes you need, and rename this file
# to "build.properties" in the same directory that contains the Struts
# "build.xml" file.
#
# $Id: build.properties.sample,v 1.4 2001/05/06 12:07:31 vmassol Exp $
# -----------------------------------------------------------------------------
# WARNING: The relative paths below assume that the build.xml file is in the
# top-level directory of the jakarta-struts source distribution (as it still
# is at the moment). If build.xml moves to under the "build" subdirectory,
# we will need to add an extra level of "../" to each of these paths.
# The directory containing your binary distribution of Tomcat 4.0 ("Catalina"
# is the servlet container part of this distribution), from CVS module
# "jakarta-tomcat-4.0" at jakarta.apache.org). This is only required
# if you are going to execute the "deploy.catalina" target.
catalina.home=../jakarta-tomcat-4.0/build
# The JAR file containing the JDBC 2.0 Optional Package extensions API
# (javax.sql). This file will automatically be added to your class path
# when you compile Struts
jdbc20ext.jar=../jdbc20/jdbc2_0-stdext.jar
# The JAR file containing the Servlet API classes to compile against (either
# version 2.2 or 2.3)
servlet.jar=../tomcat/lib/common/servlet.jar
# The directory containing your binary distribution of Tomcat 3.2, from CVS
# module "jakarta-tomcat" (and branch "TOMCAT_32") at jakarta.apache.org.
# This is only required if you are going to execute the "deploy.tomcat" target.
tomcat.home=../tomcat
# The JAR file containing the Xerces parser. This is only required if you are
# going to execute the "deploy.catalina" target.
xerces.jar=../xml-xerces/xerces.jar
# Properties related to Struts unit testing
# -----------------------------------------
# Cactus jar for the Servlet API corresponding to the servlet.jar file
# selected above (either 2.2 or 2.3)
cactus.jar = ../jakarta-commons/cactus/out/servlet22/dist/lib/commons-cactus.jar
# Cactus Ant custom tasks jar
cactus.ant.jar =
../jakarta-commons/cactus/out/servlet22/dist/lib/commons-cactus-ant.jar
# JUnit jar file
junit.jar = f:/applis/jakarta-ant-1.4alpha/lib/junit.jar
# Servlet engine locations for the tests
# Note: If you don't want to run the test on a given servlet engine, just
# comment it's home property. For example, if you don't want to run the
# tests on Tomcat 4.0, comment the "tomcat.home.40" property.
tomcat.home.32 = f:/applis/jakarta-tomcat-3.2.1
tomcat.home.40 = f:/applis/jakarta-tomcat-4.0-b1
========================================================================================================================
build.xml:
========================================================================================================================
<project name="Struts" default="compile.library" basedir=".">
<!--
Struts main build.xml file for building everything related to Struts :
- core Struts library
- documentation
- Struts web apps
- run unit tests
- ...
This script will delegate some of it's tasks to the other build*.xml
scripts (build-webapps.xml, build-tests.xml, ...)
-->
<!-- ========== Prerequisite Properties =================================== -->
<!--
These properties MUST be set on the "ant" command line, a
"build.properties" file in the base directory, or a
"build.properties" file in your user home directory.
catalina.home (optional). The path to the Tomcat 4.0
installation. This is required only when
executing the "deploy.catalina" target.
jdbc20ext.jar (required). The path to the JAR file
for the JDBC 2.0 Optional Package APIs.
servlet.jar (required). The path to the Servlet API
classes to compile against (currently,
either version 2.2 or 2.3 supported).
tomcat.home (optional). The path to the Tomcat 3.x
installation. This is required only when
executing the "deploy.tomcat" target.
xerces.jar (optional) The path to the Xerces classes
to copy. This is required only when
executing the "deploy.catalina" target.
-->
<!-- Load local and user build preferences -->
<property file="build.properties"/>
<property file="${user.home}/build.properties"/>
<!-- Default values for unspecified properties -->
<property name="catalina.home" value="../jakarta-tomcat-4.0/build"/>
<property name="jdbc20ext.jar" value="../jdbc2_0-stdext.jar"/>
<property name="servlet.jar"
value="../jakarta-servletapi/lib/servlet.jar"/>
<property name="tomcat.home" value="../build/tomcat"/>
<property name="xerces.jar" value="../xml-xerces/xerces.jar"/>
<!-- ========== Initialization Properties ================================= -->
<!--
These property values may optionally be overridden with property
settings from an "ant" command line, the "build.properties" file
in this directory, the "build.properties" file in your home
directory, or from settings in a superior build.xml script.
-->
<!-- Output directory name for all files generated by the build process -->
<property name="build.home" value="target"/>
<!-- Should Java compilations set the debug compiler option? -->
<property name="compile.debug" value="true" />
<!-- Should Java compilations set the deprecation compiler option? -->
<property name="compile.deprecation" value="false" />
<!-- Should Java compilations set the optimize compiler option? -->
<property name="compile.optimize" value="true" />
<!-- Name of the core struts library -->
<property name="app.name" value="struts"/>
<!-- Name of the project -->
<property name="project.name" value="jakarta-struts"/>
<!-- Version of the project -->
<property name="project.version" value="1.0"/>
<!-- ========== Derived Properties ======================================== -->
<!--
These property values are derived from values defined above, and
generally should NOT be overridden by command line settings
-->
<!-- The base directory for distribution targets -->
<property name="dist.home" value="dist" />
<!-- Source directory -->
<property name="src.dir" value="src"/>
<!-- Source directory for core struts library -->
<property name="src.share.dir" value="${src.dir}/share"/>
<!-- Directory where core struts library configurations files are stored -->
<property name="conf.share.dir" value="conf/share"/>
<!-- Directory where test configurations files are stored -->
<property name="conf.test.dir" value="conf/test"/>
<!-- Doc directory -->
<property name="doc.dir" value="doc"/>
<!-- Web directory -->
<property name="web.dir" value="web"/>
<!-- Compilation Classpath -->
<path id="compile.classpath">
<pathelement location="${jdbc20ext.jar}"/>
<pathelement location="${servlet.jar}"/>
</path>
<!-- ========== Executable Targets ======================================== -->
<!--
The "init" target evaluates "available" expressions as necessary
to modify the behavior of this script and print some information on
screen
-->
<target name="init">
<echo message="--------- ${project.name} ${project.version} ---------"/>
<echo message=""/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message="java.home = ${java.home}"/>
<echo message="user.home = ${user.home}"/>
</target>
<!--
Create directories and copy files for the core struts library
-->
<target name="prepare.library" depends="init">
<mkdir dir="${build.home}/library/classes/META-INF/tlds"/>
<copy file="${conf.share.dir}/struts.tld"
tofile="${build.home}/library/classes/META-INF/taglib.tld"/>
<mkdir dir="${build.home}/library/classes/org/apache/struts/resources"/>
<copy todir="${build.home}/library/classes/org/apache/struts/resources">
<fileset dir="${conf.share.dir}" includes="**/*.dtd"/>
</copy>
<copy file="${jdbc20ext.jar}"
tofile="${build.home}/library/jdbc2_0-stdext.jar"/>
</target>
<!--
Prepare static directories for web applications
-->
<target name="static.webapps">
<ant antfile="build-webapps.xml" target="static"/>
</target>
<!--
Compile core struts library directory components
-->
<target name="compile.library" depends="prepare.library"
description="Compile Struts library files">
<javac srcdir="${src.share.dir}"
destdir="${build.home}/library/classes"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${build.home}/library/classes">
<fileset dir="${src.share.dir}" includes="**/*.properties"/>
</copy>
<copy todir="${build.home}/library">
<fileset dir="${conf.share.dir}" includes="*.dtd"/>
<fileset dir="${conf.share.dir}" includes="*.tld"/>
</copy>
<style basedir="${doc.dir}"
destdir="${build.home}/library"
extension=".tld"
style="stylesheets/tld.xsl"
includes="struts-*.xml"/>
<copy todir="${build.home}/library/classes/META-INF/tlds">
<fileset dir="${build.home}/library" includes="struts-*.tld"/>
</copy>
<jar jarfile="${build.home}/library/${app.name}.jar"
manifest="${conf.share.dir}/MANIFEST.MF"
basedir="${build.home}/library/classes"
includes="**"/>
</target>
<!--
Compile code for web applications
-->
<target name="compile.webapps" depends="compile.library,static.webapps"
description="Compile Struts web applications">
<ant antfile="build-webapps.xml" target="compile"/>
</target>
<!--
Create Javadoc documentation
-->
<target name="compile.javadoc"
description="Generate JavaDoc API docs">
<delete dir="${build.home}/documentation/api"/>
<mkdir dir="${build.home}/documentation/api"/>
<javadoc sourcepath="${src.share.dir}"
destdir="${build.home}/documentation/api"
classpath="${servlet.jar}:${jdbc20ext.jar}"
packagenames="org.apache.struts.*"
author="true"
private="true"
version="true"
windowtitle="Apache Struts API Documentation"
doctitle="<h1>Apache Struts Framework (Version
${project.version})</h1>"
bottom="Copyright © 2000-2001 - Apache Software Foundation"/>
</target>
<!--
Create directories and copy files for distribution
-->
<target name="prepare.dist" depends="init">
<mkdir dir="${dist.home}"/>
<mkdir dir="${dist.home}/lib"/>
<mkdir dir="${dist.home}/webapps"/>
</target>
<!--
Construct library distributables
-->
<target name="dist.library" depends="prepare.dist,compile.library">
<copy todir="${dist.home}/lib">
<fileset dir="${build.home}/library" includes="*.dtd"/>
<fileset dir="${build.home}/library" includes="*.jar"/>
<fileset dir="${build.home}/library" includes="*.tld"/>
</copy>
<copy file="${build.home}/library/${app.name}.jar"
todir="d:\tomcat\webapps\gwp\WEB-INF\lib" />
</target>
<!--
Construct distributable web applications
-->
<target name="dist.webapps" depends="compile.webapps,compile.javadoc">
<ant antfile="build-webapps.xml" target="dist"/>
</target>
<!--
Copy sources for distribution
-->
<target name="dist.source" depends="prepare.dist">
<copy file="INSTALL" tofile="${dist.home}/INSTALL"/>
<copy file="LICENSE" tofile="${dist.home}/LICENSE"/>
<copy file="README" tofile="${dist.home}/README"/>
</target>
<!--
Construct complete release distribution
-->
<target name="dist" depends="dist.library,dist.webapps,dist.source"
description="Construct binary distribution"/>
<!--
Deploy these applications on Catalina
-->
<target name="deploy.catalina" depends="compile.webapps"
description="Deploy Struts web.apps in Catalina (Tomcat 4.0)">
<mkdir dir="${catalina.home}/webapps/struts-blank"/>
<copy todir="${catalina.home}/webapps/struts-blank">
<fileset dir="${build.home}/blank"/>
</copy>
<copy todir="${catalina.home}/webapps/struts-blank/WEB-INF/lib"
file="${xerces.jar}"/>
<mkdir dir="${catalina.home}/webapps/struts-documentation"/>
<copy todir="${catalina.home}/webapps/struts-documentation">
<fileset dir="${build.home}/documentation"/>
</copy>
<mkdir dir="${catalina.home}/webapps/struts-example"/>
<copy todir="${catalina.home}/webapps/struts-example">
<fileset dir="${build.home}/example"/>
</copy>
<copy todir="${catalina.home}/webapps/struts-example/WEB-INF/lib"
file="${xerces.jar}"/>
<mkdir dir="${catalina.home}/webapps/struts-template"/>
<copy todir="${catalina.home}/webapps/struts-template">
<fileset dir="${build.home}/template-example"/>
</copy>
<copy todir="${catalina.home}/webapps/struts-template/WEB-INF/lib"
file="${xerces.jar}"/>
<mkdir dir="${catalina.home}/webapps/struts-exercise-taglib"/>
<copy todir="${catalina.home}/webapps/struts-exercise-taglib">
<fileset dir="${build.home}/exercise-taglib"/>
</copy>
<copy
todir="${catalina.home}/webapps/struts-exercise-taglib/WEB-INF/lib"
file="${xerces.jar}"/>
<mkdir dir="${catalina.home}/webapps/struts-upload"/>
<copy todir="${catalina.home}/webapps/struts-upload">
<fileset dir="${build.home}/upload"/>
</copy>
<copy todir="${catalina.home}/webapps/struts-upload/WEB-INF/lib"
file="${xerces.jar}"/>
</target>
<!--
Deploy these applications on Tomcat
-->
<target name="deploy.tomcat" depends="compile.webapps"
description="Deploy Struts web.apps in Tomcat 3.x">
<mkdir dir="${tomcat.home}/webapps/struts-blank"/>
<copy todir="${tomcat.home}/webapps/struts-blank">
<fileset dir="${build.home}/blank"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-documentation"/>
<copy todir="${tomcat.home}/webapps/struts-documentation">
<fileset dir="${build.home}/documentation"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-example"/>
<copy todir="${tomcat.home}/webapps/struts-example">
<fileset dir="${build.home}/example"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-template"/>
<copy todir="${tomcat.home}/webapps/struts-template">
<fileset dir="${build.home}/template-example"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-exercise-taglib"/>
<copy todir="${tomcat.home}/webapps/struts-exercise-taglib">
<fileset dir="${build.home}/exercise-taglib"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-upload"/>
<copy todir="${tomcat.home}/webapps/struts-upload">
<fileset dir="${build.home}/upload"/>
</copy>
</target>
<!--
Clean up build and distribution directories
-->
<target name="clean"
description="Clean build and distribution directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
<!--
All-in-one build target
-->
<target name="all" depends="clean,compile.library,compile.webapps"
description="Clean and build library and web applications"/>
<!--
Run tests on all servers not commented out in the build.properties file.
-->
<target name="test.all" depends="test.tomcat.32,test.tomcat.40"
description="Run unit tests on all servlet engines">
</target>
<!--
Display a warning message if the needed servlet engine home property
is not set (for Tomcat 3.2)
-->
<target name="check.tests.tomcat.32" depends="compile.library"
unless="tomcat.home.32">
<echo message=""/>
<echo
message="*********************************************************"/>
<echo message="WARNING : The 'tomcat.home.32' property has not been
set."/>
<echo message=" No test will be run on that servlet engine."/>
<echo
message="*********************************************************"/>
<echo message=""/>
</target>
<!--
Run the Struts unit tests in the Tomcat 3.2 servlet engine
-->
<target name="test.tomcat.32"
depends="check.tests.tomcat.32,compile.library"
if="tomcat.home.32" description="Run unit tests on Tomcat 3.2">
<echo message="tomcat.home.32 = ${tomcat.home.32}"/>
<ant antfile="build-tests.xml" target="test.tomcat.32"/>
</target>
<!--
Display a warning message if the needed servlet engine home property
is not set (for Tomcat 4)
-->
<target name="check.tests.tomcat.40" depends="compile.library"
unless="tomcat.home.40">
<echo message=""/>
<echo
message="*********************************************************"/>
<echo message="WARNING : The 'tomcat.home.40' property has not been
set."/>
<echo message=" No test will be run on that servlet engine."/>
<echo
message="*********************************************************"/>
<echo message=""/>
</target>
<!--
Run the Struts unit tests in the Tomcat 4.0 servlet engine
-->
<target name="test.tomcat.40"
depends="check.tests.tomcat.40,compile.library"
if="tomcat.home.40" description="Run unit tests on Tomcat 4.0">
<echo message="tomcat.home.40 = ${tomcat.home.40}"/>
<ant antfile="build-tests.xml" target="test.tomcat.40"/>
</target>
</project>
========================================================================================================================
env.bat which I run before hand (should put classpaths in build.xml but quicker
this way!):
========================================================================================================================
set classpath=%classpath%;.
set classpath=%classpath%;d:\xalan-j_1_2_2\xerces.jar
set classpath=%classpath%;d:\xalan-j_1_2_2\xalan.jar
set classpath=%classpath%;d:\tomcat\lib\common\parser.jar
set path=%path%;d:\jakarta-ant-1.3\bin
========================================================================================================================
Let me know if I can help any more.
Dave
Michael McCafferty <[EMAIL PROTECTED]> on 06/22/2001
05:56:06 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: David Hay/Lex/Lexmark)
Subject: newbie - requesting example of working build.xml, build.properties
files
Hi all,
I am trying to build struts from source, and having an unexpectedly
difficult time of it. I have downloaded the source code from CVS, and
followed the directions listed on
http://jakarta.apache.org/struts/installation.html without success.
I have copied the $STRUTS/build.properties.sample to build.properties
and edited existing entries accordingly. I have also copied
$STRUTS/build-webapp.xml to build.xml and edited existing values
accordingly. For all prerequesite properties listed in build-webapp.xml
(lines 29-86) I am specifying a command line option to "ant."
I'm probably missing something obvious, but I'm coming to the conclusion
that the sample configuration files require a LOT of customization in
order to build a vanilla version of struts from source. I'd love to see
copies of build.xml and build.properties that someone has used to
successfully compile the software.
Thanks in advance,
Michael McCafferty
[EMAIL PROTECTED]