You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ye huaiguang <gr...@gmail.com> on 2005/12/02 10:10:33 UTC
does "property" could have several values?
hi,
I'm a newbie of Ant, now I have a question, I want to define classpath, but
they aren't in one place, like this
<!-- lib directory-->
<property name="lib.dir" value="D:/Java/hibernate" />
<!-- define classpath -->
<path id="project.class.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${class.dir}" />
</path>
but now my value should be "D:/Java/hibernate" &="D:/Java/hibernate/lib",
should I write them like this?
<property name="lib.dir"
value="D:/Java/hibernate;D:/Java/hibernate/lib" />
or
<property name="lib.dir" value="D:/Java/hibernate" />
<property name="lib.dir" value="D:/Java/hibernate/lib" />
I know I could copy all the jars to one directory, but I think it's quirk,
so I came here to find better way.Thanks!
Re: does "property" could have several values?
Posted by ye huaiguang <gr...@gmail.com>.
hi
Thanks ddevienne, now I can resolve my problem, but I still have a question,
if my JARs even in a drivers, like "D:\java\lib" & "e:\java\lib", How could
I do in this situation?
2005/12/4, Dominique Devienne <dd...@gmail.com>:
>
> > but now my value should be "D:/Java/hibernate"
> &="D:/Java/hibernate/lib",
> > should I write them like this?
> > <property name="lib.dir"
> > value="D:/Java/hibernate;D:/Java/hibernate/lib" />
> > or
> > <property name="lib.dir" value="D:/Java/hibernate" />
> > <property name="lib.dir" value="D:/Java/hibernate/lib" />
> >
> > I know I could copy all the jars to one directory, but I think it's
> quirk,
> > so I came here to find better way.Thanks!
>
> A property is just a string. You can put whatever you want in it. But
> <fileset dir=...> on the other hand expects a directory name, so if
> you pass it a string that doesn't correspond to a dir name, then it
> will fail.
>
> Here one way (among several) that you can achieve what you want:
>
> <property name="lib.dir" value="D:/Java/hibernate" />
> <path id="project.class.path">
> <fileset dir="${lib.dir}">
> <include name="*.jar"/>
> <include name="lib/*.jar"/>
> </fileset>
> <pathelement location="${class.dir}" />
> </path>
>
> --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: does "property" could have several values?
Posted by Dominique Devienne <dd...@gmail.com>.
> but now my value should be "D:/Java/hibernate" &="D:/Java/hibernate/lib",
> should I write them like this?
> <property name="lib.dir"
> value="D:/Java/hibernate;D:/Java/hibernate/lib" />
> or
> <property name="lib.dir" value="D:/Java/hibernate" />
> <property name="lib.dir" value="D:/Java/hibernate/lib" />
>
> I know I could copy all the jars to one directory, but I think it's quirk,
> so I came here to find better way.Thanks!
A property is just a string. You can put whatever you want in it. But
<fileset dir=...> on the other hand expects a directory name, so if
you pass it a string that doesn't correspond to a dir name, then it
will fail.
Here one way (among several) that you can achieve what you want:
<property name="lib.dir" value="D:/Java/hibernate" />
<path id="project.class.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
<include name="lib/*.jar"/>
</fileset>
<pathelement location="${class.dir}" />
</path>
--DD
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org