Hello,

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 http://ant.apache.org/manual/CoreTasks/manifest.html ).
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.


Cheers,

Antoine

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="${user.name}"/>
            </manifest>
        </presetdef>

        <jar jarfile="anttest.jar" basedir="." includes="build.xml">
             <my.manifest/>
        </jar>
    </target>
</project>
------------------------------

Here is the output from executing the script above:
BUILD FAILED
/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to