On Wed, 2006-06-28 at 18:22 +0530, Raghuveer wrote:
> jan Thanks a lot for info.
> 
> imagine if buil.xml and buil.properties are in path
> F:\tsource\ant
> 
> My Web application is in path.
> F:/oc4j_extended/j2ee/home/applications
> 
> 
> After making changes in xml file as below
> project.test=Test Web Application
> basedir=F:/oc4j_extended/j2ee/home/applications/test/
> 
> <project name="test"   default="all">
> <property file="build.properties"/>
>     <echo>${project.test}</echo>
>       <echo>${basedir}</echo>
> 
> Output is
> 
> F:\tsource\ant>ant
> Buildfile: build.xml
>      [echo] Test Web Application
>      [echo] F:\tsource\ant
> BUILD FAILED
> F:\tsource\ant\build.xml:62: F:\tsource\ant\src not found.

Typically you would define a property pointing to the location of the
source, and use that in the task that builds the source. 

eg. 

  <property name="source.dir" value="src"/>

In this case, the property is relative to the basedir set in the project
tag. It is common practise to have the build.xml and build.properties in
or near the tree containing the source, unlike the example you gave
above. If you do require them to be separate, using an absolute path, or
a relative path concatenated onto an environment variable may be useful.

Eg.

  <property environment="env"/>
  <property 
    name="source.dir"  
    value="${env.OC4J_HOME}/j2ee/home/applications/src"
   />

Having a look at some example ant files is a great way to get the hang
of this. The build.xml that builds ant is a good one - you can view it
here:

http://svn.apache.org/viewvc/ant/core/trunk/build.xml?revision=411884&view=markup&pathrev=415345

Cheers, Ben

> 
> What other changes i need to do
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 28, 2006 5:29 PM
> To: user@ant.apache.org
> Subject: AW: build.properties
> 
> 
> Ant cant find the property file because you set the basedir="../"
> 
> Jan 
> 
> >-----Ursprüngliche Nachricht-----
> >Von: Raghuveer [mailto:[EMAIL PROTECTED] 
> >Gesendet: Mittwoch, 28. Juni 2006 13:40
> >An: 'Ant Users List'
> >Betreff: RE: build.properties
> >
> >I made follwoing changes 
> >
> >In build.properties
> >-------------
> >project.title=Test Web Application
> >project.version = 1.3
> >distpath.project = F:/oc4j_extended/j2ee/home/applications
> >
> >In build.xml
> >-------------
> ><project name="test"  basedir="../" default="all"> <property 
> >file="build.properties"/>
> >
> >      <echo>${project.title}</echo>
> >       <echo>${project.version}</echo>
> >        <echo>${distpath.project}</echo>
> >---------------------------------------
> >when i run ant i am not getting the values from 
> >build.properties ,instead below output is coming  [echo] 
> >${project.title}  [echo] ${project.version}  [echo] ${distpath.project}
> >
> >Finally i am getting BUIL FAILED message
> >
> >
> >-----Original Message-----
> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, June 28, 2006 1:06 PM
> >To: user@ant.apache.org; [EMAIL PROTECTED]
> >Subject: AW: build.properties
> >
> >
> >>In my build.xml if i want to get the the value of "distpath.project" 
> >>(path of my web application context in OC4J
> >>server) from build.properties .
> >>
> >>What Changes i need to avil this requirement ?
> >>
> >>-------------------------
> >><project name="testapp"  basedir="../" default="all">
> >>
> >><!-- Project settings -->
> >>    <property name="project.title" value="Test Web application"/>
> >>    <property name="project.version" value="1.0"/>
> >>    <property name="distpath.project"
> >>value="F:/oc4j_extended/j2ee/home/applications"/>
> >
> >
> >build.xml
> >---------
> ><project ...>
> >    <property file="build.properties"/>
> ></project>
> >
> >
> >build.properties
> >----------------
> >project.title=Test Web application
> >project.version=1.0
> >distpath.project=F:/oc4j_extended/j2ee/home/applications
> >
> >
> >
> >Inside the buildfile you have
> >    <property name="NAME" value="VALUE"/> and with property 
> >files you load these mappings
> >    <property file=""/>
> >    NAME=VALUE # COMMENT
> >
> >
> >
> >Jan
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED] For 
> >additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to