You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Manivannan Palanichamy <ma...@gmail.com> on 2007/08/07 20:35:59 UTC

regarding path id

Hi,
Actually, I add the jar files in classpath using the following way.
   <path id="sab.classpath">
      <pathelement location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
      <pathelement location="${resc}/activation.jar"/>
      <pathelement location="${resc}/imap.jar"/>
   </path>

It looks bit tedious, since every jar file should be listed in the
pathelement tag. Instead of doing this, is there anyway to specify a
directory, containing all jar files?

-- 
Manivannan.Palanichamy (@) Oracle.com
http://mani.gw.googlepages.com/index.html

Re: regarding path id

Posted by Peter Reilly <pe...@gmail.com>.
On 8/8/07, Anil Kumar pippalapalli <ap...@gmail.com> wrote:
> hi mani,
>
> you can do this,
> <pathelement location="${resc}/**/*.jar"/>
This will not work.
The ** and * are for patterns - line includes="" and the <include> element.
The location attribute is a file name/path and not a pattern.

Peter

> this will take care of all jars in that folder and subfolders....
>
> anil.
>
>
> On 8/8/07, Manivannan Palanichamy <ma...@gmail.com> wrote:
> >
> > Hi,
> > Actually, I add the jar files in classpath using the following way.
> >   <path id="sab.classpath">
> >      <pathelement location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
> >      <pathelement location="${resc}/activation.jar"/>
> >      <pathelement location="${resc}/imap.jar"/>
> >   </path>
> >
> > It looks bit tedious, since every jar file should be listed in the
> > pathelement tag. Instead of doing this, is there anyway to specify a
> > directory, containing all jar files?
> >
> > --
> > Manivannan.Palanichamy (@) Oracle.com
> > http://mani.gw.googlepages.com/index.html
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: regarding path id

Posted by Anil Kumar pippalapalli <ap...@gmail.com>.
hi mani,

you can do this,
<pathelement location="${resc}/**/*.jar"/>
this will take care of all jars in that folder and subfolders....

anil.


On 8/8/07, Manivannan Palanichamy <ma...@gmail.com> wrote:
>
> Hi,
> Actually, I add the jar files in classpath using the following way.
>   <path id="sab.classpath">
>      <pathelement location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
>      <pathelement location="${resc}/activation.jar"/>
>      <pathelement location="${resc}/imap.jar"/>
>   </path>
>
> It looks bit tedious, since every jar file should be listed in the
> pathelement tag. Instead of doing this, is there anyway to specify a
> directory, containing all jar files?
>
> --
> Manivannan.Palanichamy (@) Oracle.com
> http://mani.gw.googlepages.com/index.html
>

Re: regarding path id

Posted by Peter Reilly <pe...@gmail.com>.
On 8/7/07, Manivannan Palanichamy <ma...@gmail.com> wrote:
> Hi,
> Actually, I add the jar files in classpath using the following way.
>    <path id="sab.classpath">
>       <pathelement location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
>       <pathelement location="${resc}/activation.jar"/>
>       <pathelement location="${resc}/imap.jar"/>

use:
   <path id="sab.classpath">
       <fileset dir="${resc}" includes="*.jar"/>
   </path>

Peter

>    </path>
>
> It looks bit tedious, since every jar file should be listed in the
> pathelement tag. Instead of doing this, is there anyway to specify a
> directory, containing all jar files?
>
> --
> Manivannan.Palanichamy (@) Oracle.com
> http://mani.gw.googlepages.com/index.html
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: regarding path id

Posted by David Weintraub <qa...@gmail.com>.
You can use the <fileset> element to define a path:

<path id="sab.classpath">
    <fileset dir="${resc}"/>
</path>

You can limit files inside the <fileset> directive too using <include>
and <exclude>:

<path id="sab.classpath">
    <fileset dir="${resc}">
        <include name="*.jar"/>
        <include name="*.zip"/>
        <exclude name="bad.jar"/>
    </fileset>
</path>

The great advantage of this is that you can easily add new jars to
your classpath by simply adding jar files into that directory.


On 8/7/07, Manivannan Palanichamy <ma...@gmail.com> wrote:
> Hi,
> Actually, I add the jar files in classpath using the following way.
>    <path id="sab.classpath">
>       <pathelement location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
>       <pathelement location="${resc}/activation.jar"/>
>       <pathelement location="${resc}/imap.jar"/>
>    </path>
>
> It looks bit tedious, since every jar file should be listed in the
> pathelement tag. Instead of doing this, is there anyway to specify a
> directory, containing all jar files?
>
> --
> Manivannan.Palanichamy (@) Oracle.com
> http://mani.gw.googlepages.com/index.html
>


-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: regarding path id

Posted by Matt Benson <gu...@yahoo.com>.
--- Manivannan Palanichamy
<ma...@gmail.com> wrote:

> Hi,
> Actually, I add the jar files in classpath using the
> following way.
>    <path id="sab.classpath">
>       <pathelement
>
location="${resc}/mysql-connector-java-3.1.12-bin.jar"/>
>       <pathelement
> location="${resc}/activation.jar"/>
>       <pathelement location="${resc}/imap.jar"/>
>    </path>
> 
> It looks bit tedious, since every jar file should be
> listed in the
> pathelement tag. Instead of doing this, is there
> anyway to specify a
> directory, containing all jar files?
> 

Indeed, and you will learn all about it at
http://ant.apache.org/manual/using.html#path .

-Matt

> -- 
> Manivannan.Palanichamy (@) Oracle.com
> http://mani.gw.googlepages.com/index.html
> 



       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org