ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack J. Woehr" <>
Subject Re: <whichresource> More on the Resource case
Date Sun, 11 Jan 2004 22:25:13 GMT wrote:

> Thank you for your quick action.

Well, I'm not an Ant committer. I just tried what you said, found you were correct,
and offered a change to the Ant community. You and I both could have overlooked
some issue in this case! :-) Let's see what happens.

> How about "resource" case?

That works okay.  For example, I have my SoftWoehr class library source tree residing
under /usr/local/work/SoftWoehr/ ... Here is a modified test case like before:

     <?xml version="1.0" standalone="yes"?>

     <project name="test-whichresource" default="dotest">
         <target name="dotest">
             <whichresource property="testresult" class=""/>
          <echo message="${testresult}"/>
      <whichresource property="testresult.bis" resource="com/SoftWoehr/images/meu.jpg"
           <echo message="${testresult.bis}"/>

The output is as follows:

          [echo] jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/Main.class
          [echo] file:/usr/local/work/SoftWoehr/com/SoftWoehr/images/meu.jpg

Resource loading *does* work that way with a leading slash in the path. I guess that's what
the issue about class loading.

Jack J. Woehr      # We have gone from the horse and buggy
Senior Consultant  # to the moon rocket in one lifetime, but
Purematrix, Inc.   # there has not been a corresponding moral # growth in mankind. - Dwight D. Eisenhower

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message