The attached message has had some or all attachments deleted because of the following
reason:
Message contains attachments: build.bat
Additional Information:
none
Hi !
See the attached files. Edit the build.xml and change this line:
<property name="app.name" value="SB_URM"/>
Set the value to your application's directory name, and run the batch. Thats
it.
----- Original Message -----
From: "Anshul" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 10:51 AM
Subject: How to make a war file
> I have got all the file structure ready to make this archive. But how do
we
> create one? I didn't find it being demonstrated at any place.
> I studied that it's similar to jar. So what do I do? jar cvf xyz.jar abc?
> And rename xyz.jar to xyz.war?
>
>
<!-- A "project" describes a set of targets that may be requested
when Ant is executed. The "default" attribute defines the
target which is executed if no specific target is requested,
and the "basedir" attribute defines the current working directory
from which Ant executes the requested task. This is normally
set to the current working directory.
-->
<project name="Schichtbuch" default="dist" basedir=".">
<!-- Property Definitions
Each of the following properties are used by convention in this
build file. The values specified can be overridden at run time by
adding a "-Dname=value" argument to the command line that invokes Ant.
This technique is normally used to copy the values of the ANT_HOME
and TOMCAT_HOME environment variables into the "ant.home" and
"tomcat.home" properties, which are normally not defined explicitly.
app.name Base name of this application, used to
construct filenames and directories.
deploy.home The name of the directory into which the
deployment hierarchy will be created.
Normally, this will be the name of a
subdirectory under $TOMCAT_HOME/webapps.
dist.home The name of the base directory in which
distribution files are created.
dist.src The name of the distribution JAR file
containing the application source code,
to be stored in the "dist.home" directory.
This filename should end with ".jar".
dist.war The name of the Web ARchive (WAR) file
containing our deployable application.
This filename should end with ".war".
javadoc.home The name of the base directory in which
the JavaDoc documentation for this application
is generated.
tomcat.home The name of the base directory in which
Tomcat has been installed. This value is
normally set automatically from the value
of the TOMCAT_HOME environment variable.
In the example below, the application being developed will be deployed
to a subdirectory named "myapp", and will therefore be accessible at:
http://localhost:8080/myapp
-->
<property name="app.name" value="SB_URM"/>
<property name="deploy.home" value="${tomcat.home}/webapps/${app.name}"/>
<property name="dist.home" value="${deploy.home}"/>
<property name="dist.src" value="${app.name}.jar"/>
<property name="dist.war" value="${app.name}.war"/>
<property name="javadoc.home" value="${deploy.home}/javadoc"/>
<!-- The "prepare" target is used to construct the deployment home
directory structure (if necessary), and to copy in static files
as required. In the example below, Ant is instructed to create
the deployment directory, copy the contents of the "web/" source
hierarchy, and set up the WEB-INF subdirectory appropriately.
<copydir src="web" dest="${deploy.home}"/>
<mkdir dir="${deploy.home}/WEB-INF"/>
<copyfile src="etc/web.xml" dest="${deploy.home}/WEB-INF/web.xml"/>
-->
<target name="prepare">
<mkdir dir="${deploy.home}"/>
<mkdir dir="${deploy.home}/WEB-INF/classes"/>
<mkdir dir="${deploy.home}/WEB-INF/lib"/>
<copydir src="${deploy.home}/WEB-INF/lib" dest="${deploy.home}/lib"/>
<copydir src="${deploy.home}/WEB-INF/classes" dest="${deploy.home}/classes"/>
<mkdir dir="${javadoc.home}"/>
</target>
<!-- The "clean" target removes the deployment home directory structure,
so that the next time the "compile" target is requested, it will need
to compile everything from scratch.
-->
<target name="clean">
<deltree dir="${deploy.home}"/>
</target>
<!-- The "compile" target is used to compile (or recompile) the Java classes
that make up this web application. The recommended source code directory
structure makes this very easy because the <javac> task automatically
works its way down a source code hierarchy and compiles any class that
has not yet been compiled, or where the source file is newer than the
class file. After compilation is complete, any non-Java files (such as
properties files containing resource bundles) found in the source code
hierarchy are copied to a corresponding position in the destination
directory hierarchy.
Feel free to adjust the compilation option parameters (debug,
optimize, and deprecation) to suit your requirements. It is also
possible to base them on properties, so that you can adjust this
behavior at runtime.
The "compile" task depends on the "prepare" task, so the deployment
home directory structure will be created if needed the first time.
-->
<target name="compile" depends="prepare">
<javac srcdir="src" destdir="${deploy.home}/WEB-INF/classes"
classpath="${deploy.home}/WEB-INF/classes"
debug="on" optimize="off" deprecation="off"/>
</target>
<!-- The "javadoc" target is used to create the Javadoc API documentation
for the Java classes in this web application. It is assumed that
this documentation is included in the deployed application, so the
example below generates the Javadoc HTML files in a subdirectory under
the deployment home directory.
-->
<target name="javadoc" depends="prepare">
<!-- TODO -->
</target>
<!-- The "all" target rebuilds everything by executing the "clean"
target first, which forces the "compile" target to compile all
source code instead of just the files that have been changed.
-->
<target name="all" depends="clean,prepare,compile,javadoc"/>
<!-- The "dist" target builds the distribution Web ARchive (WAR) file
for this application, suitable for distribution to sites that wish
to install your application. It also creates a JAR file containing
the source code for this application, if you wish to distribute
that separately.
<target name="dist" depends="prepare,compile">
-->
<target name="dist" depends="prepare">
<jar jarfile="${dist.home}/${dist.src}"
basedir="."/>
<jar jarfile="${dist.home}/${dist.war}"
basedir="."/>
</target>
</project>
build.bat