Site Search :
Standard Enterprise XML Methodology Pattern Setting Tunning Other
Article Contributors
GuestBook
Javapattern Maven
XSourceGen Dev
JetSpeed Test
JLook Image
jLook Family Site


Weblogic EJB Deploy using ANT build
 
Weblogic8.1À» »ùÇ÷ΠÇÏ¿© EJB jarÆÄÀÏÀÇ ºôµå¸¦ ÇÒ¼ö ÀÖµµ·Ï properties¹× build.xmlÀ» Á¤ÀÇÇϵµ·Ï ÇÏÀÚ. ( 2003/06/09 ) 382
Written by ienvyou - ÃÖÁö¿õ
1 of 1
 


¢º Weblogic Deploy using ANT

¿©±â¼­´Â °£´ÜÇÏ°Ô À¥·ÎÁ÷À» ±â¹ÝÀ¸·Î ANT¸¦ ÀÌ¿ëÇÑ deploy¸¦ Çغ¸µµ·Ï ÇÑ´Ù.
ÇÒ¶§ ¸¶´Ù Çò°¥·Á¼­ ¾ÆƼŬ ¾´´Ù.

¢º Foler ±¸Á¶ 

±âº»ÀûÀÎ ÆúÅÍÀÇ ±¸Á¶´Â ´ÙÀ½°ú °°´Ù. 
 
ÆÐÅ°Áö¸í¿¡ ÀÇÇÑ sourceµð·ºÅ丮°¡ »ý¼ºµÇ¾îÁ® ÀÖÀ¸¸ç, ±× ¾Æ·¡ Home Interface, Remote Interface, 
Enterprise BeanŬ·¡½º°¡ À§Ä¡ÇÏ°Ô µÇ¸ç ¼¼°³ÀÇ ±âº»ÀûÀÎ ÆÄÀÏÀ» ÀÌ¿ëÇÑ XMLÆÄÀÏÀº
xmlÀ̶ó´Â µð·ºÅ丮¸¦ °¡Á¤ÇÏ¿© Å×½ºÆ®ÇÑ´Ù.

project_home --
                    |
                    ----ebiz
                           |
                           ----admin
                                    |
                                    ----Admin.java, AdminHome.java, AdminEJB.java(files)
                                    |
                                    ----xml (weblogic-ejbjar.xml, ejb-jar.xmlÀÌ À§Ä¡)
                                    |
                                    --- conf (ANT-build¸¦ À§ÇÑ ÇÁ·ÎÆÛƼ ÀúÀå¼Ò)
                                    |
                                    ----build (ºôµåÆÄÀÏ ÃÖÁ¾ ŸÄϵð·ºÅ丮)

À§¿Í °°Àº ±¸Á¶·Î ¼Ò½º»ùÇÃÀ» Á¦°øÇϸç, ¾Æ·¡´Â compile, making jar, ejbc, deploy±îÁöÀÇ
±â´ÉÀ» ant xml buildÆÄÀÏ·Î Á¦°øÇÑ´Ù.

¿ì¼± confµð·ºÅ丮¹ØÀÇ build.propertiesÆÄÀÏÀ» º¸µµ·Ï ÇÏÀÚ.

¢º build.properties 


#choose classic, modern, jikes, or jvc
JAVAC=modern
#JAVA_HOME=/export/home/bea/jdk141_02
#WL_HOME=/export/home/bea/weblogic81
WL_HOME=C:/bea/weblogic81
PROJECT_HOME=.

APPLICATIONS=.

#class.path=.:/export/home/bea/weblogic81/server/lib/weblogic.jar:
class.path=.;C:/bea/weblogic81/server/lib/weblogic.jar;

¢º build.xml

<project name="ejb-basic-statelessSession" default="all" basedir=".">

  <!-- set global properties for this build -->
  <property environment="env"/>
  <property file="./conf/build.properties"/>
  <property name="build" value="build"/>
  <property name="dist" value="dist"/>
  <property name="jar.name" value="Ebiz.Admin.AdminEJB"/>


  <target name="all" depends="init, compile_ejb, jar_ejb, ejbc, copy-to-applications, clean"/>

  <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="xml">
        <include name="*.xml"/>
        <exclude name="build.xml"/>
      </fileset>
    </copy>
  </target>
  

  <!-- Compile ejb classes into the build directory (jar preparation) -->
  <target name="compile_ejb" >
  	<echo>${class.path}</echo>
    <javac srcdir="." destdir="${build}" classpath="${class.path}"/>
  </target>

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

  <!-- Run ejbc to create the deployable jar file -->
  <target name="ejbc" depends="jar_ejb">
  <echo>${class.path}</echo>
    <java classname="weblogic.ejbc" fork="yes">
      <sysproperty key="weblogic.home" value="${WL_HOME}"/>
      <arg line="-compiler javac ${dist}/_${jar.name}.jar ${dist}/${jar.name}.jar"/>
      <classpath>
        <pathelement path="${WL_HOME}/server/lib/weblogic.jar;${class.path};"/>
      </classpath>
    </java>
  </target>
  <target name="copy-to-applications" depends="ejbc">
    <copy todir="/export/home/bea/user_projects/mydomain/applications">
      <fileset dir="dist">
     	    <include name="${jar.name}.jar"/>
      </fileset>
    </copy>
  </target>

  <target name="clean">
    <delete file="${dist}/_${jar.name}.jar"/>
    <delete dir="${build}"/>
    <delete dir="ejbcgen"/>
  </target>
</project>

¢º Conclusion À§¿Í °°Àº ÆÄÀϵéÀº ejbÀÇ µð·ºÅ丮¿¡ copy-pasteÇüÅ·Π¹Ýº¹ÀûÀ¸·Î »ç¿ëµÇ¾îÁú ¼ö ÀÖÀ¸¸ç ´Ü¼øÈ÷ build.xmlÀÇ 9¹ø° ¶óÀο¡ ÀÖ´Â ejbÀÇ jarÆÄÀÏÀÌ »ý¼ºµÉ À̸§¸¸ ¹Ù²Ù¾îÁشٸé Àç»ç¿ëµÇ¾îÁú ¼ö ÀÖ´Ù. ¶ÇÇÑ ejb°¢°¢ÀÇ µð·ºÅ丮º°·Î build.xmlÀ» ÀÌ¿ëÇÏ¿© ÃÖ»óÀ§ buildÆÄÀÏ¿¡¼­ <target name="build-ejb"> <ant dir="src/ebiz/admin" target="all"/> </target> °ú °°ÀÌ Á¤ÀÇÇÔÀ¸·Î¼­ Çѹø¿¡ ¸ðµç ÇÁ·ÎÁ§Æ®ÀÇ ºôµå¸¦ ¼º°ø½Ãų¼ö ÀÖµµ·Ï ¸µÅ©¸¦ °É¾îÁØ´Ù¸é ¾ÆÁÖ Æí¸®ÇÏ°Ô »ç¿ëµÉ ¼ö ÀÖÀ» °ÍÀÌ´Ù. º» ±Û ÀÛ¼º½Ã°£ 15ºÐ... ¾Æ~ ª¾Ò´Ù.. ^^ ANTÅÂÅ©¸¦ È¿°úÀûÀ¸·Î »ç¿ëÇÑ´Ù¸é ¾ÆÁÖ¾ÆÁÖ À¯¿ëÇÏ°Ô ÇÁ·ÎÁ§Æ®¸¦ ÁøÇàÇØ ³ª°¥¼ö ÀÖÀ¸¸®¶ó~
 
1
References
 
This Source : EJBDeploy.zip
Copyright ¨Ï 2003 www.javapattern.info & www.jlook.com, an jLOOK co.,LTD