Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the college_fest directory you can also find two build files, build.xml and jboss-build.xml. build.xml is the default build file so if you just type ant this file will be used for building the application. For this particular sample application the jboss-build.xml file is provided.

From a command line, still within the college_fest directory type the following command:

...

With this command, ant will use the targets defined in the jboss-build.xml file to build the College Fest application and deploy it to the JBoss server. Take a special look at <target name="deploy" ...>, here is where the jboss-build.xml tell ant where to deploy the WAR file. The following example shows the definitions in the jboss-build.xml file.

...

The previous step showed how to deploy the application at build time by specifying a customized jboss-build.xml file. If you used the default build.xml file at build time you still need to deploy the College Fest application manually. To deploy the College Fest application in JBoss, copy the college_fest.war file you just built with Ant to the following directory:

...

Last time you built the College Fest sample application it was configured for ant to use the jboss-build.xml file instead of the default build.xml. The following example shows the content of the default build.xml file.

Code Block
xml
xml
borderStylesolid
titlebuild.xml
<?xml version="1.0"?>
<!-- build file for building a war -->

<project name="build" default="war" basedir=".">

    <property file="build.properties"/>
    <property name="src.dir" value="src"/>
    <property name="dest.dir" value="bin"/>


    <target name="clean" description="Delete all generated files.">
        <echo message="Deleting bin folder" />
        <delete dir="bin"/>
    </target>

      <target name="compile">
    	<mkdir dir="${dest.dir}"/>

        <javac srcdir="${src.dir}" destdir="${dest.dir}">
            <classpath path="${java.home}/lib/tools.jar"/>
            <!--classpath path="${j2ee.home}/lib/j2ee.jar"/-->
            <classpath path="${geronimo.home}/repository/org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.1/geronimo-servlet_2.5_spec-1.1.jar" />
        </javac>
    </target>

    <target name="war" depends="compile">
        <war destfile="college_fest.war" webxml="WEB-INF/web.xml">
            <zipfileset dir="jsp" prefix="jsp"/>
            <zipfileset dir="pix" prefix="pix"/>   	    
            <classes dir="${dest.dir}"/>    
            <webinf dir="WEB-INF" />
        </war>
</target>


</project>

...