ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Relative path names in result classpath
Date Fri, 25 Oct 2002 15:07:18 GMT
<pathconvert> is indeed the solution to your problem. It's sometime tricky
to use though, because of platform-specific file separator issues. Here's a
few pointer.

Define your comp.dir.external property using <property location=""/>. This
ensure the same kind of path conversion than <path> does.

Use that variable in both <fileset dir="var"/> and <pathconvert><map

If you still can't sort it out, post again will info specific to your
<pathconvert>ion. --DD

-----Original Message-----
From: Peter Klotz [] 
Sent: Friday, October 25, 2002 7:08 AM
Subject: Relative path names in result classpath


I have defined a fileset with a lot of jar files relative to a certain 
directory. Then I build a classpath referencing the fileset. That works 
fine. But now I want to write the classpath to a .bat or .sh file and 
annoyingly I always get all path components as absolute pathnames. I 
even tried pathconvert task to remove the leading part but that did not 
So the question is how do I get relative names in a path? There is no 
option, there is no mentioning in the docs etc.

A build.xml snipplet:

<fileset id="jars.external" dir="${comp.dir.external}" casesensitive="yes">
   <include name="avalon/avalon-framework-4.1.2.jar"/>
   <include name="avalon/excalibur-cli-1.0.jar"/>
<path id="classpath.external">
   <fileset refid="jars.external"/>

Then I'm using the classpath with classpathrefid="classpath.external" or 
   in a property
   <property name="clp.external" refid="classpath.external"/>

But always the result is a absolute path but I want relative because the 
list is so long that it e.g. exceeds the line length in a .bat file, 
also I need a relative pathname so that one can move the program 
directory simply and still everything works.

I can immagine that many people have the same problem?
How did you solve it?

Thanks for your help,


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

View raw message