How to Pass parameters for a Ant script , which is invoked via shell script?

ShellScriptingAntShellexecute

Shell Problem Overview


I need to invoke a ant script via shell script. Let us consider the parameters for ant script are a,b,c. how can i pass the parameter for those variables? I must provide the parameters for ant vis invoke the shell script. can anyone help me on this?

Shell Solutions


Solution 1 - Shell

Do you mean assigning value to a property from command line? If so, try

-DpropertyName=itsValue

For example,

<project>
    <target name="hi">
        <property name="person" value="world"/>
        <echo message="Hello ${person}"/>
    </target>
</project>

and then

ant -Dperson="MerryPrankster" hi

yields

 [echo] Hello MerryPrankster

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontrilawneyView Question on Stackoverflow
Solution 1 - ShellmerrypranksterView Answer on Stackoverflow