ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Nicholson" <rob...@elastica.com>
Subject How are relative paths resolved?
Date Wed, 16 May 2001 04:57:38 GMT
Consider the two sets of rules

<target name="customerejbjar" depends="init">
    <property name="customer.buildjardir"
value="${customer.home}/build/ejbjar"/>
    <mkdir dir="${customer.buildjardir}/META-INF"/>
    <copydir src="${customer.classbindir}" dest="${customer.buildjardir}" />
    <copydir src="${util.classbindir}" dest="${customer.buildjardir}" />
    <copyfile src="customer_ejb.xml"
dest="${customer.buildjardir}/META-INF/ejb-jar.xml" />
    <copyfile src="weblogic-ejb-jar.xml"
dest="${customer.buildjardir}/META-INF/weblogic-ejb-jar.xml" />
    <delete file="${customer.ejbjar}"/>
    <jar jarfile="${customer.ejbjar}" basedir="${customer.buildjardir}"/>
    <deltree dir="${customer.buildjardir}"/>
  </target>

  <target name="ejbc" depends="init">
  	<java classname="weblogic.ejbc" fork="no"
classpath="${weblogic.classpath}" args="-compiler javac ${customer.ejbjar}
${customer.ejbcjar}"/>
  </target>

Note: when a relative path ie. a path with a .. is an attribute value above
it's
resolved to an absolute path. But in the second target where I'm using
${customer.ejbjar} it doesn't have the intelligence to resolve this to an
absolute rule consequently ant
chokes.

What's confusing to me is that if I involve this via an ant target
specifycing this build.xml it will not work but if my current directory is
the same as where this
bulid.xml is then it will find that relative path.

Very confused.

Executing Target: customerejbjar
Created dir: D:\Java\jps1.1.2\src\components\customer\build\ejbjar\META-INF
Copying 48 files to D:\Java\jps1.1.2\src\components\customer\build\ejbjar
Copying 1 files to D:\Java\jps1.1.2\src\components\customer\build\ejbjar
Deleting: D:\Java\jps1.1.2\src\components\customer\build\customerEjb.jar
Building jar: D:\Java\jps1.1.2\src\components\customer\build\customerEjb.jar
Deleting: D:\Java\jps1.1.2\src\components\customer\build\ejbjar
Executing Target: ejbc
ERROR: ejb-jar file: ../build/customerEjb.jar could not be opened.

You see. every rule resolves correctly to an absolute path except this
value.

I was trying to use the ant that ships with the Petstore rather than
configure up another version and have to configure the parser factory up.

...

So how exactly are paths resolved in Ant or am I clutching at straws here?


Mime
View raw message