ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Manifests, copy task
Date Fri, 16 Nov 2001 11:31:40 GMT
Couple of questions...
I'd like to create an ant task to bundle some code with the libs it depends upon in a jar
with its main-class and class-path attributes set. Since ant knows everything there is to
know about what I need it goes against the grain to write a separate manifest file.

Conor MacNeil says (here
that its an undocumented fact that you can set up manifest attributes within the jar task.
This seems just dandy except it doesn't say if it is possible to use a path structure to build
the class-path property? Also, is what Conor's saying right? I have the 1.4 code in front
of me and I can't see anything in the jar task or 'manifest' code that would allow this?

On an unrelated note... does anyone else find it odd that the 'copy' task can add a fileset
but not a path? The problem is thia: suppose I create a build.xml such as that described in
the Tomcat Application Developers Guide (see
, particularly the section on external dependencies). Then I'll have a bunch of properties
like this:
<property name="some.jar" value="/external/path/to/some-v1.2.jar"/>
Which I then bundle into a path object like this:
<path id="compile.classpath"><pathelement location="${some.jar}"/></path>

I'd then refer to this classpath in compile, javadoc, (etc) tasks. However to copy the jars
into the deliverable I have to write a separate copy statement for each jar, since the copy
task can't refer to a path...

I know there are other ways to avoid this unnecessary duplication (I'm going with copying
everything I need into the build directory THEN setting up the classpath - maybe I should
send this as a suggestion to the tomcat documenter?) but it seems to me that paths are just
as much collections of files as filesets, and we ought to be able to use them that way, in
any task which expects a fileset. 


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message