Problem in making EAR

"aqilengineer" <[email protected]> Wed, 03 Apr 2002 08:22:28 -0000
Newsgroups gmane.comp.java.ejb.general
Message-ID <[email protected]>
Following r the build.xml files for my project , 
1)i want to make a One build.xml file , combining these Two files 
2)in the following Two files , no war & ear is made but i want to 
make war & ear in my One build.xml file

i've explored all the build files of sample/examples folder but have 
not found any such example. Can anyone do it for me or help me to do 
it

In petstore example there is build.xml which do it but its very 
confusing,like i'm unable to know that ,is it necessary to make a 
clientEJB.jar file for making a war file in weblogic so that ejb's 
can be accessed by jsp's ?? 

i've posted the complete source code in file section, in Aqil 
directory ,with description as 'making EAR problem'

Thanks


==========Build.xml(For JSP)===========================
<project name="jsp" default="all" basedir=".">

  <property environment="env"/>
  <property file="../../examples.properties"/>

  <!-- set global properties for this build -->
  <property name="source" value="."/>

  <target name="all" depends="compile_all, copy"/>

  <!-- Creates jsp_servlet directory under WEB-INF\classes of the 
Examples Web
    APP and places the compiled jsp classes into it -->
  <target name="compile_all">
    <execon executable="java" parallel="true" failonerror="yes">
     <arg value="weblogic.jspc" />
     <arg line="-d ${EX_WEBAPP_CLASSES}"/>
     <srcfile />
     <fileset dir="${source}" includes="*.jsp" />
    </execon>
  </target>

  <target name="copy">
    <copy todir="${APPLICATIONS}/examplesWebApp">
      <fileset dir="${source}">
        <include name="*.jsp"/>
      </fileset>
    </copy>
  </target>

</project>
===============build.xml(For EJB)==========================
<project name="ejb-basic-statelessSession" default="all" basedir=".">

  <!-- set global properties for this build -->
  <property environment="env"/>
  <property file="../../../../examples.properties"/>
  <property name="source" value="."/>
  <property name="build" value="${source}/build"/>
  <property name="dist" value="${source}/dist"/>

  <target name="all" depends="clean, init, compile_ejb, jar_ejb, ejbc,
    compile_webapp, compile_client"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile
    and copy the deployment descriptors into it-->
    <mkdir dir="${build}"/>
    <mkdir dir="${build}/META-INF"/>
    <mkdir dir="${dist}"/>
    <copy todir="${build}/META-INF">
      <fileset dir="${source}">
        <include name="*.xml"/>
        <exclude name="build.xml"/>
      </fileset>
    </copy>
  </target>

  <!-- Compile ejb classes into the build directory (jar 
preparation) -->
  <target name="compile_ejb">
    <javac srcdir="${source}" destdir="${build}"
       includes="Trader.java, TraderHome.java, TradeResult.java,
         TraderBean.java"/>
  </target>

  <!-- Make a standard ejb jar file, including XML deployment 
descriptors -->
  <target name="jar_ejb" depends="compile_ejb">
    <jar jarfile="${dist}/std_ejb_basic_statelessSession.jar"
      basedir="${build}">
    </jar>
  </target>

  <!-- Run ejbc to create the deployable jar file -->
  <target name="ejbc" depends="jar_ejb">
    <java classname="weblogic.ejbc" fork="yes">
      <sysproperty key="weblogic.home" value="${WL_HOME}"/>
      <arg line="-compiler javac 
${dist}/std_ejb_basic_statelessSession.jar 
${APPLICATIONS}/ejb_basic_statelessSession.jar"/>
      <classpath>
        <pathelement 
path="${WL_HOME}/lib/weblogic_sp.jar;${WL_HOME}/lib/weblogic.jar"/>
      </classpath>
    </java>
  </target>

  <!-- Compile handler class into WEB-INF/classes directory of the 
Examples Web
    App.  This ensures that the EJB can be accessed by JSPs of the 
Examples Web
    App-->
  <target name="compile_webapp">
    <javac srcdir="${source}"
      destdir="${EX_WEBAPP_CLASSES}"
      includes="Trader.java, TraderHome.java, TradeResult.java"
    />
  </target>

  <!-- Compile EJB interfaces & client app into the clientclasses 
directory -->
  <target name="compile_client">
    <javac srcdir="${source}"
      destdir="${CLIENT_CLASSES}"
      includes="Trader.java, TraderHome.java, TradeResult.java, 
Client.java"
    />
  </target>

  <target name="clean">
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>