[ Team LiB ] |
![]() ![]() |
Recipe 2.7 Deploying a Web Application on WebLogic Using AntProblemYou want to deploy a web application on WebLogic Server 7.0 using Jakarta Ant. SolutionCreate a Jakarta Ant build file. Ant can automatically compile your servlet classes, create a web-application archive (.war) file, and then deploy the WAR to WebLogic Server 7.0. DiscussionYou can either manually cut and paste web components into the WebLogic applications directory (as described in the sidebar), or use Ant to automate the process of compiling, generating a WAR file, and copying the WAR to this directory. An example directory path to applications is k:\bea\user_projects\bwpdomain\applications. This method would entail a minor edit of the build.xml and build.properties files described in Recipe 2.6.
This deploy-application Ant target is edited in build.xml to deploy on WebLogic 7.0: <target name="deploy-application" depends="prepare" description="Compile the web application...."> <echo message="Compiling the application files..."/> <javac srcdir="${src}" destdir="${build}"> <include name="*.java" /> <classpath refid="classpath"/> </javac> <echo message="creating the WAR file...."/> <antcall target="create-war"/> <copy todir="${wl.applications}"> <fileset dir="${dist}" /> </copy> </target> In addition, the build.properties file could define the wl.applications property with a value such as "k:\bea\user_projects\bwpdomain\applications". Once the WAR file is copied to this special directory, a WebLogic server that is started in development mode will automatically deploy it.
See AlsoRecipe 2.3; Recipe 2.8-Recipe 2.10; WebLogic's Server 7.0 programmer documentation: http://e-docs.bea.com/wls/docs70/programming.html. ![]() |
[ Team LiB ] |
![]() ![]() |