ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis ANDRE <>
Subject Re: ANT 1.7: ManifestClasspath How does it work??
Date Fri, 09 Nov 2007 18:08:23 GMT
The Ant documentation specifies for the <ant> task:

dir: the directory to use as a basedir for the new Ant project. Defaults to the 
current project's basedir, unless inheritall has been set to false, in which 
case it doesn't have a default value. This will override the basedir setting of 
the called project.

So, IMHO, calling as command line:
C:\MyProj\MySubProj\ant -f build.xml echo-manifest

or calling <ant dir="MySubProj" target="echo-manifest"/>
from the build.xml file located in C:\MyProj should produce the same result 
since the basedir of the new Ant project is the same as the implicit basedir 
from the previous command line invocation.


Dominique Devienne a écrit :
> On 11/9/07, <> wrote:
>> With the following code:
>> <manifestclasspath property="jar.classpath"  jarfile="BlogJDO_EJBClient.jar">
>>   <classpath>
>>     <filelist>
>>       <file name="connector_1_5_0.jar"/>
>>     </filelist>
>>   </classpath>
>> </manifestclasspath>
> You're problem is likely that you don't use file names which are unambiguous.
> <manifestclasspath> needs to compute the relative path between the
> jarfile, and the jars or directories listed in the classpath. But you
> are using a relative path for jarfile, and filelist for the classpath,
> so jarfile's location depends on the build's basedir, which can be
> different if you can the build directly or via another build that
> <ant>'s it (since <ant> can force the sub-build to use another
> basedir, something I abhor personally ;-), and filelist are just names
> of files that don't have to exists, so again what absolute filename
> this will map to also depends on the context.
> I seems to me that you are using manifest classpath as if you wanted
> the "text" of the files you specify in filelists to be used as is,
> when <manifestclasspath> was designed to *compute* the in-manifest
> classpath from existing files.
> Feed it real files that exist (via <fileset> or <pathelement
> location="" /> if order matters, which it shouldn't of course! ;-),
> and anchor your jarfile filename to a path always the same in all
> contexts (using a property, or ensuring basedir is really what you
> think it should be), and the task will get you the correct manifest
> classpath all the time.
> --DD
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message