Friday Jan 06, 2012

APPC from ANT

Further to my earlier article on using the weblogic.appc command to precompile the pages in ADF applications the question came up about how to automate the same thing from Ant. 

Now in principle this should be pretty simple as the same appc command is available as an Ant task.  However, the documentation is not particularly illuminating and completely lacks any examples so you can fumble around for hours if you're a skim reader and don't pay really close attention. 

Anyway an example is worth a 1000 words. Here's the same example as last time but in Ant form.  You will still need to follow the same process for digging out the libraries that you require.

build.xml

<project name="AppcTest" default="precompile" basedir=".">
  <description>Sample build file using Ant to call WLS APPC</description>

  <property name="wls_root" value="C:/builds/WLS_PS4" />
  <property name="wls_home" value="${wls_root}/wlserver_10.3" />
  <property name="adf_lib_root" value="${wls_root}/oracle_common/modules"/>
  <property name="common_lib_root" value="${wls_home}/common/deployable-libraries"/>  

  <path id="wls.classpath">
    <fileset dir="${wls_home}/server/lib">
      <include name="*.jar"/>
    </fileset>
  </path>

  <taskdef name="wlappc" classpathref="wls.classpath" 
           classname="weblogic.ant.taskdefs.j2ee.Appc"/>  

  <target name="precompile" description="Calls WLS APPC to pre-compile an EAR">
    <wlappc source="myapp.ear" 
            verbose="true" 
            classpath="${adf_lib_root}/oracle.adf.share_11.1.1/adfsharembean.jar" >
      <library file="${adf_lib_root}/oracle.adf.view_11.1.1/adf.oracle.domain.webapp.war"/>
      <library file="${adf_lib_root}/oracle.adf.model_11.1.1/adf.oracle.domain.ear"/>
      <library file="${common_lib_root}/jstl-1.2.war"/>
      <library file="${common_lib_root}/jsf-1.2.war"/>
    </wlappc>
  </target>

</project>
About

Hawaii, Yes! Duncan has been around Oracle technology way too long but occasionally has interesting things to say. He works in the Development Tools Division at Oracle, but you guessed that right? In his spare time he contributes to the Hudson CI Server Project at Eclipse
Follow DuncanMills on Twitter

Note that comments on this blog are moderated so (1) There may be a delay before it gets published (2) I reserve the right to ignore silly questions and comment spam is not tolerated - it gets deleted so don't even bother, we all have better things to do with our lives.
However, don't be put off, I want to hear what you have to say!

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today