Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File ant读取键值属性文件_File_Ant_Properties File - Fatal编程技术网

File ant读取键值属性文件

File ant读取键值属性文件,file,ant,properties-file,File,Ant,Properties File,我有如下属性文件(user.properties): ip=10.161.16.755 names={"10.161.16.75":"v1"} adminPassword=admin sshUserName=r sshPassword=v vc.username=administrator@address.local 我想把vc.username和names读入一些变量,然后在ant中使用它们。 如何实现这一点?您可以在构建xml中包含属性文件 <property file="user.

我有如下属性文件(user.properties):

ip=10.161.16.755
names={"10.161.16.75":"v1"}
adminPassword=admin
sshUserName=r
sshPassword=v
vc.username=administrator@address.local
我想把
vc.username
names
读入一些变量,然后在ant中使用它们。
如何实现这一点?

您可以在
构建xml中包含属性文件

<property file="user.properties"/>

现在,您可以像使用变量一样使用属性文件中定义的所有键。例如:

${vc.username}
将为您提供
administrator@address.local


希望这有帮助

您可以在
构建xml中包含属性文件

<property file="user.properties"/>

现在,您可以像使用变量一样使用属性文件中定义的所有键。例如:

${vc.username}
将为您提供
administrator@address.local

希望这有帮助

您也可以参考您也可以参考