Thursday, May 8, 2014

Properties in Build.xml

Following is a part of the build config file of my app

  <property name="app.name"      value="ApplicationName"/>  <!-- rename to suit your project name-->
  <property name="app.version"   value="1.0"/>
  <property name="build.home"    value="build"/>
  <property name="catalina.home" value="D:\Oracle\Middleware\wlserver_12.1"/> <!-- UPDATE THIS! -->
  <property name="deploy.home"   value="D:\Oracle\Middleware\wlserver_12.1\${app.name}"/>
  <property name="dist.home"     value="D:\Oracle\Middleware\user_projects\domains\base_domain\autodeploy"/>
  <property name="src.home"      value="src"/>
  <property name="struts.home"   value="./web/WEB-INF/lib"/>

the property that says "property name="dist.home"  needs to be mapped to the auto deploy directory of you domain.

Unless this is done, the application cannot be opened on the browser as the weblogic server wont have any

handle/reference to the war files deployed any were else apart form the autodeploy directory


On the contrary if you are using a JBoss server, your auto deploy directory configuration can be some thing like

thie following

<!-- ===================== Property Definitions =========================== -->

<!--

  Each of the following properties are used in the build script.
  Values for these properties are set by the first place they are 
  defined, from the following list:
  * Definitions on the "ant" command line (ant -Dcatalina.home=xyz compile)
  * Definitions from a "build.properties" file in the top level
    source directory
  * Definitions from a "build.properties" file in the developer's
    home directory
  * Default definitions in this build.xml file

  You will note below that property values can be composed based on the
  contents of previously defined properties.  This is a powerful technique
  that helps you minimize the number of changes required when your development
  environment is modified.  Note that property composition is allowed within
  "build.properties" files as well as in the "build.xml" script.

-->

  <property file="build.properties"/>
  <property file="${user.home}/build.properties"/>


<!-- ==================== File and Directory Names ======================== -->

<!--

  These properties generally define file and directory names (or paths) that
  affect where the build process stores its outputs.

  app.name             Base name of this application, used to
                       construct filenames and directories.
                       Defaults to "myapp".

  app.version          Version identifier for this application.

  build.home           The directory into which the "prepare" and
                       "compile" targets will generate their output.
                       Defaults to "build".

  catalina.home        The directory in which you have installed
                       a binary distribution of Tomcat 4.  This will
                       be used by the "deploy" target.

  deploy.home          The name of the directory into which the
                       deployment hierarchy will be created, and into
                       which the build directory will be copied.
                       Defaults to "${catalina.home}/webapps/${app.name}".

  dist.home            The name of the base directory in which
                       distribution files are created.
                       Defaults to "dist".

-->

   <property name="app.name"      value="ApplicationName"/>  <!-- rename to suit your project name-->
   <property name="app.version"   value="1.0"/>
   <property name="build.home"    value="build"/>
   <property name="catalina.home" value="D:\jboss-4.2.2.GA\jboss-4.2.2.GA\jboss-4.2.2.GA"/> <!-- UPDATE

THIS! -->
   <property name="deploy.home"   value="D:\Oracle\Middleware\user_projects\domains\base_domain

\autodeploy\${app.name}"/>
   <property name="dist.home"     value="D:\Oracle\Middleware\user_projects\domains\base_domain

\autodeploy"/>
   <property name="src.home"      value="src"/>
   <property name="struts.home"   value="./web/WEB-INF/lib"/>

 

 

No comments:

Post a Comment