有没有办法将所有 ant 命令行参数作为属性传递给 java 任务?
例如: ant -Dprop1=value1 -Dprop2=value2 ... -file build.xml myTarget
<target name="myTarget">
<java classname="MyClass">
<sysproperty ... all properties>
</java>
</target>
因此启动的 jvm 将具有从 ant 命令行传递的所有属性。
谢谢
最佳答案
试试这个:
<java ...>
<syspropertyset>
<propertyref regex=".*"/>
</syspropertyset>
</java>
关于java - ant 将所有参数传递给 java 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8659403/