ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: Problem nesting presetdef in another task
Date Thu, 29 Jul 2004 19:44:30 GMT


this sounds like a bug or a limitation of presetdef. The documentation 
says that presetdef can be used with any type or task.
There is another issue which can explain the problem.
the <manifest/> tag inside a target or the body of a project is a task 
used to create a manifest file.(see ).
the same <manifest/> tag inside <jar/> or a task derived from jar (war, 
ear) instructs ant to create an inline manifest for the archive.
In this case, the <manifest/> tag refers to another Java class.
I do not know enough how presetdef is implemented and how introspection 
works to figure out what is happening.
It is possible that presetdef thinks that you are referring to the 
manifest task, which is globally known in ant. The manifest nested type 
of jar is only known in jar and derivatives.



David Esterkin wrote:

> Hello,
> I created a presetdef of a <manifest> element, and then tried to use 
> it as a sub-element of <jar>.
> When I execute the script, the build fails with a message stating this 
> is an unsupported nested element.
> Here is a sample build script.  In addition, to the form shown below, 
> I have tried defining the presetdef outside of any targets (as a 
> direct sub-element of project),
> ------------------------------
> <?xml version="1.0"?>
> <project name="anttest" default="jar" basedir=".">
>     <target name="jar">
>         <presetdef name="my.manifest">
>             <manifest>
>                 <attribute name="Built-By" value="${}"/>
>             </manifest>
>         </presetdef>
>         <jar jarfile="anttest.jar" basedir="." includes="build.xml">
>              <my.manifest/>
>         </jar>
>     </target>
> </project>
> ------------------------------
> Here is the output from executing the script above:
> /java/projects/anttest/build.xml:11: The <jar> type doesn't support 
> the nested "my.manifest" element.
> Thanks for any help with this.
> David

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

View raw message