All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.cluster-j2ee14.src.build.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0"?>
<!--
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - JOnAS: Java(TM) Open Application Server
 - Copyright (C) 2005 Bull S.A.
 - Contact: [email protected]
 -
 - This library is free software; you can redistribute it and/or
 - modify it under the terms of the GNU Lesser General Public
 - License as published by the Free Software Foundation; either
 - version 2.1 of the License, or any later version.
 -
 - This library is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 - Lesser General Public License for more details.
 -
 - You should have received a copy of the GNU Lesser General Public
 - License along with this library; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 - USA
 -
 - Initial developer(s):
 - Contributor(s):
 -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - $Id: build.xml 15428 2008-10-07 11:20:29Z sauthieg $
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -->



<project name="J2EE Application for JOnAS Cluster"
     default="install"
     basedir=".">

  <!-- build.properties hold the properties that can be customized -->
  <property file="../build.properties" />

  <!-- some properties are build from environment variables -->
  <property environment="myenv"/>
  <property name="jonas.root" value="${myenv.JONAS_ROOT}" />

  <property name="src.dir" value="." />
  <property name="xml.dir" value="etc" />
  <property name="classes.dir" value="../classes" />
  <property name="dist.dir" value="../output" />
  <property name="dist.ejbjars.dir" value="${dist.dir}/ejbjars" />
  <property name="dist.webapps.dir" value="${dist.dir}/webapps" />
  <property name="dist.apps.dir" value="${dist.dir}/apps" />
  <property name="lib.dir" value="${jonas.root}/lib" />

 <!-- ejbjar task  -->
 <taskdef name="ejbjar"
    classname="org.ow2.jonas.ant.EjbJar"
    classpath="${jonas.root}/lib/common/ow_jonas_ant.jar" />

  <!-- The classpath to be used to compile examples -->
  <path id="base.classpath">
    <pathelement location="${classes.dir}" />
    <fileset dir="${lib.dir}/commons">
          <include name="j2ee/*.jar" />
      </fileset>
    <fileset dir="${lib.dir}/common">
          <include name="log/*.jar" />
        <include name="ow_jonas_bootstrap.jar" />
        <include name="ow_jonas.jar" />
      </fileset>

    <fileset dir="${lib.dir}">
      <include name="client.jar"/>
      <include name="web_catalina.jar"/>
    </fileset>

  </path>


  <target name="mydtd"
      description="rebuild ./build.dtd for DOCTYPE">
    <antstructure output="build.dtd"/>
  </target>

  <target name="init">
    <!-- directories building -->
    <mkdir dir="${classes.dir}" />
    <mkdir dir="${dist.dir}" />
    <mkdir dir="${dist.apps.dir}" />
    <mkdir dir="${dist.ejbjars.dir}" />
    <mkdir dir="${dist.webapps.dir}" />
    <mkdir dir="${dist.webapps.dir}/j3x/WEB-INF/classes" />
    <mkdir dir="${dist.webapps.dir}/j3x/WEB-INF/lib" />
    <condition property="jonas.base" value="${myenv.JONAS_BASE}">
        <available file="${myenv.JONAS_BASE}"/>
    </condition>
    <condition property="jonas.base" value="${jonas.root}">
        <available file="${jonas.root}"/>
    </condition>
  </target>

  <target name="clean"
      description="Removes all the generated files or directories">
    <delete dir="${classes.dir}" />
    <delete dir="${dist.dir}" />
  </target>

  <target name="compile"
      description="Compiles J2EE Applicatio for JOnAS cluster"
      depends="init" >
    <javac srcdir="${src.dir}/beans"
       destdir="${classes.dir}"
       debug="${opt.javac.debug}"
       optimize="${opt.javac.optimize}">
      <classpath refid="base.classpath" />
    </javac>
    <javac srcdir="${src.dir}/j3x"
       destdir="${dist.webapps.dir}/j3x/WEB-INF/classes"
       debug="${opt.javac.debug}"
       optimize="${opt.javac.optimize}">
      <classpath refid="base.classpath" />
    </javac>
  </target>


  <!-- Deploying ejbjars via ejbjar task  -->
  <target name="jonasejbjar"
      description="Build and deploy the ejb-jars"
      depends="compile" >

    <ejbjar basejarname="ejbs"
        srcdir="${classes.dir}"
        descriptordir="${src.dir}/beans"
        dependency="full">
      <jonas destdir="${dist.ejbjars.dir}"
         jonasroot="${jonas.root}"
         protocols="${protocols.names}"
         keepgenerated="true"
         verbose="${verbose}"
         additionalargs="${genicargs}">
      </jonas>
      <include name="**/*.xml"/>
      <exclude name="**/jonas-*.xml"/>
      <exclude name="**/build.xml" />
    </ejbjar>
  </target>

  <target name="war"
      description="Build the war file"
      depends="jonasejbjar" >
    <copy todir="${dist.webapps.dir}/j3x/WEB-INF/lib">
        <fileset dir="${dist.ejbjars.dir}" includes="ejbs.jar"/>
        </copy>
    <war warfile="${dist.webapps.dir}/j3x.war" webxml="${src.dir}/j3x/WEB-INF/web.xml">
        <webinf dir="${src.dir}/j3x/WEB-INF" includes="jonas-web.xml" />
        <zipfileset dir="${src.dir}/j3x/web" prefix="" />
        <classes dir="${dist.webapps.dir}/j3x/WEB-INF/classes" />
        <lib dir="${dist.webapps.dir}/j3x/WEB-INF/lib" />
    </war>
  </target>

  <target name="ear"
      description="Build the ear file"
      depends="war" >
    <ear earfile="${dist.apps.dir}/clusterapp.ear"
     appxml="${src.dir}/application.xml">
      <fileset dir="${dist.ejbjars.dir}" includes="ejbs.jar"/>
      <fileset dir="${dist.webapps.dir}" includes="j3x.war"/>
    </ear>
  </target>

  <target name="install"
      description="Build and install the JOnAS alarm example"
      depends="ear" >
    <!-- Copy ear-jar files in JONAS_BASE -->
    <copy todir="${jonas.base}/apps">
      <fileset dir="${dist.apps.dir}"
           includes="clusterapp.ear" />
    </copy>

<!--
    <copy todir="${jonas.base}/webapps/autoload">
      <fileset dir="${dist.webapps.dir}"
           includes="j3x.war" />
    </copy>
-->
  </target>

</project>






© 2015 - 2025 Weber Informatics LLC | Privacy Policy