You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Klara Ward <kl...@appeal.se> on 2003/05/06 09:15:12 UTC

Re: adding to classpath used in target

I solved this by calling ant from:
        <java classname="org.apache.tools.ant.Main"
           fork="true"
           failonerror="true"
           >
         <arg line="-Dant.home=${ant.home}"/>
         <arg line="-f ${foo}/build.xml"/>
     <arg line="-Dvm=${jvm}"/>
     <arg line="-Dtest=${test}"/>
         <classpath>
           <pathelement location="${bar.home}/bar.jar"/>
           <pathelement path="${java.class.path}"/>
         </classpath>
       </java>

A pain when you would really want inheritsAll="true", but at least the 
classpath got set.

Klara


"Klara Ward wrote:

> It did not work adding a <classpath> to <ant>
>
> So how can I do it instead?
>
> Klara
>
> Klara Ward wrote:
>
>> I run an antscript from a .cmd/.sh file, and inside the antscript I 
>> run an <ant> task.
>> This ant task needs to have a certain jar-file in the classpath when 
>> it's running.
>> The jar-file can have different versions and the currently used 
>> version is stated in a properties file.
>> Is there someway I can wait until I get into the first ant-script 
>> before adding this jar to the classpath
>> and not have to set it in the CLASSPATH variable in the  .cmd/.sh 
>> file (which leads to redundancies)
>>
>> Can I just add a <classpath> tag to <ant>, and how do I know it uses 
>> both the classpath ant starts with, and the jar file I added?
>> Klara
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>