有说法Ant任务 [英] Ant task with argument

查看:250
本文介绍了有说法Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Apache config.xml中配置IPv6。我通过阅读ADDR6的IP。我想将它传递给这样的命令 - 蚂蚁-f config.xml中configureForIPv6<知识产权及GT; 。我们的目标是很容易通过,但我如何通过知识产权的说法?蚂蚁不喜欢ARG值。

 <蚂蚁antfile =$ {} APACHE_HOME /config.xml目标=configureForIPv6ARG = -  DIPv6_Interface = $ {} ADDR6inheritRefs =真> ?


解决方案

有两种方式可能的从命令行设置属性。

首先,对于任何Java应用程序,使用 -D 来定义属性:

 蚂蚁-f config.xml中configureForIPv6 -DADDR =<知识产权及GT;

二,把值(或值)在Java属性文件(比如被称为SETTINGS.TXT),内容可能是:

  ADDR =<知识产权及GT;

然后阅读使用Ant文件 -propertyfile 选项,例如:

 蚂蚁-f config.xml中configureForIPv6 -propertyfile SETTINGS.TXT

I have to configure IPV6 through Apache config.xml. I read the IP through ADDR6. I want to pass it to the command like this - ant -f config.xml configureForIPv6 <IP>. The target is easy to pass, but how do i pass the argument for IP? Ant does not like the arg value.

<ant antfile="${APACHE_HOME}/config.xml" target="configureForIPv6" arg="-DIPv6_Interface=${ADDR6}" inheritRefs="true"> ?

解决方案

There are two ways you might set properties from the command line.

First, as for any Java application, use -D to define the property:

ant -f config.xml configureForIPv6 -DADDR=<IP>

Second, put the value (or values) in a Java property file (say called 'settings.txt'), content might be:

ADDR=<IP>

then read the file using the Ant -propertyfile option, e.g.:

ant -f config.xml configureForIPv6 -propertyfile settings.txt

这篇关于有说法Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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