You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by hezjing <he...@gmail.com> on 2008/11/07 17:14:12 UTC
Creating WAR by referring to pathelement?
Hi
I have defined the following paths,
<path id="compile.class.path">
<pathelement path="X.jar" />
</path>
<path id="runtime.class.path">
<pathelement path="Y.jar" />
</path>
Both of the above compile and runtime JARs are bundled in a WAR like this,
<war destfile="my.war" webxml="web.xml">
<lib file="X.jar" />
<lib file="Y.jar" />
</war>
Do you have any idea of how should I simply this, so that the WAR task is
able to retrieve the files specified by compile.class.path and
runtime.class.path?
Instead of me typing the same JARs in different places?
--
Hez
AW: Creating WAR by referring to pathelement?
Posted by Ja...@rzf.fin-nrw.de.
> <path id="compile.class.path">
> <pathelement path="X.jar" />
> </path>
>
> <path id="runtime.class.path">
> <pathelement path="Y.jar" />
> </path>
>
>
> <war destfile="my.war" webxml="web.xml">
> <lib file="X.jar" />
> <lib file="Y.jar" />
> </war>
<web><lib> is a <zipfileset> therefore referencing a <path> wouldnt work
I think.
<war><lib refid="compile.classpath"/><lib
refid="runtime.class.path"/></war>
But referencing another <fileset> should work.
<path id="compile.class.path">
<fileset id="fs.compile.libs" dir="." includes="X.jar" />
</path>
<path id="runtime.class.path">
<fileset id="fs.rt.libs" dir="." includes="Y.jar" />
</path>
<war destfile="my.war" webxml="web.xml">
<lib refid="fs.compile.libs" />
<lib refid="fs.rt.libs" />
</war>
But because of the use of fileset the referenced libraries have to have
the same base
directory. (Or you must specify a fileset for each base directory.)
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org