蚂蚁将所有参数传递给java任务 [英] ant passing all parameters to a java task

查看:27
本文介绍了蚂蚁将所有参数传递给java任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将所有 ant 命令行参数作为属性传递给 java 任务?

Is there a way to pass all ant command-line parameters as properties to a java task ?

例如:ant -Dprop1=value1 -Dprop2=value2 ... -file build.xml myTarget

For example : ant -Dprop1=value1 -Dprop2=value2 ... -file build.xml myTarget

    <target name="myTarget">
    <java classname="MyClass">
     <sysproperty ... all properties>
    </java>
    </target>

因此启动的 jvm 将具有从 ant 命令行传递的所有属性.

So the started jvm will have all properties passed from the ant command-line.

谢谢

推荐答案

试试这个:

<java ...>
    <syspropertyset>
        <propertyref regex=".*"/>
    </syspropertyset>
</java>

这篇关于蚂蚁将所有参数传递给java任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆