使用命令行参数创建ant目标
我正在使用ant XML来管理存储库和一些东西,我想运行一个传递命令行参数的目标,如下所示:使用命令行参数创建ant目标,ant,arguments,command-line-arguments,target,Ant,Arguments,Command Line Arguments,Target,我正在使用ant XML来管理存储库和一些东西,我想运行一个传递命令行参数的目标,如下所示: ant deploy-stable 0.0.1 如何将目标配置为接收“0.0.1”作为参数 <target name="deploy-stable"> <!-- Run git targets, previously defined, using the version passed by command line --> </target> 我找到了
ant deploy-stable 0.0.1
如何将目标配置为接收“0.0.1”作为参数
<target name="deploy-stable">
<!-- Run git targets, previously defined, using the version passed by command line -->
</target>
我找到了一种方法,可以使用命令行ant-Dversion 0.0.1 deploy stable
,使用另一种方法在没有“-Dversion”的情况下运行?听起来您希望它成为ant中的一个属性,而-D正是这样做的。根据apache,没有其他方法可以直接在命令行上指定属性。如果你解释为什么你在寻找另一种方法,它可能会引出一些想法。