ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Al Le" <>
Subject macrodef with parameters to pass to java task
Date Mon, 29 May 2017 10:04:52 GMT

in my ant script I'd like to define a macro (via macrodef) which would call the 'java' task
as a part of its body/implementation.

In the java task call in the macro, I want to just specify the main class name and the classpath.
The parameters (which are usually specified via nested 'arg' elements) should be as variable
as they are in the original java task.

How would I accomplish this?

What I've come up with until now is:
    <macrodef name="execMyProgram">
        <element name="programArgs" implicit="true" description="'arg' entries for the
program, use like in the java task"/>
            <java classname="" classpathref="my.classpath">

Then I use the macro as follows:

            <arg value="arg1"/>
            <arg value="arg2"/>

But I get the error message: The <java> type doesn't support the nested "programArgs"

Thank you for the help!


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

View raw message