ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pritesh saharey <>
Subject Re: classpath
Date Tue, 18 Mar 2003 05:05:55 GMT
or do it like this

<path id="classpath">
		<fileset dir="../lib">
			<include name="*.jar"/>

and for java task use it like this

<java append="true" fork="true" failonerror="true" 
					<arg line="-f ..."/>

--- Erik Hatcher <> wrote:
>You've just touched on one of the nicest things about Ant... its path 
>handling.  Yes, Ant can do this easily, for example:
>     <path id="common.compile.classpath">
>         <pathelement location="${lucene.jar}"/>
>     </path>
>     <path id="common.test.classpath">
>         <pathelement location="${junit.jar}"/>
>         <path refid="common.compile.classpath"/>
>     </path>
>So common path is defined and then a larger path is constructed using 
>it (nevermind the property references for now, if you aren't familiar 
>with the ${...} syntax).
>Then use either classpathref="common.compile.classpath" on <java> and 
><javac> or use the nested <classpath> element with the same nested 
><path refid="..."> construct as shown above to pull in a previously 
>defined path.
>	Erik
>On Monday, March 17, 2003, at 04:59  PM, Matthew Hardin wrote:
>> Is it possible to set a classpath element that can be
>> used throughout your build file? In other words, I have
>> several java and javac tasks within my file that all
>> use the same classpath.  Yet it seems I have to define
>> it for everyone. How can I consolidate this to one
>> place so I only have to make one change when it needs
>> updating?
>> Thanks,
>> Matthew Hardin
>> Matthew Hardin
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Join Community  --->

Select your own custom email address for FREE! Get w/No Ads, 6MB, POP &

View raw message