Using the deploy task in a macro

If many artifacts need to be copied/deployed, than a simple ANT macro can lighten the amount of duplication in your ANT script

    
    <target name="example.macro">
            <deploy-to-env artifact="someEJBz.jar" />
            <deploy-to-env artifact="myWebApp.war" />
            <deploy-to-env artifact="datasource.xml" />
    </target>
        
    <macrodef name="deploy-to-env">
        <attribute name="artifact"/>
        <sequential>
            <echo>Copying @{artifact} to some environment</echo>
            <deploy 
                luntUsername="luntuser" 
                luntPassword="luntpassword" 
                luntServer="http://your-luntserver:8080"
                project="@{project}" 
                schedule="myLuntProject" 
                artifact="myLuntSchedule" 
                deployUsername="foouser" 
                deployPassword="barpassword" 
                deployServer="your-server"
                deployDir="/deployDir   "/>
            </sequential>
    </macrodef>