Shell 如何设置ant属性;“output.root”;在贝壳里?
我需要从Cygwin shell中指定ant属性Shell 如何设置ant属性;“output.root”;在贝壳里?,shell,ant,cygwin,Shell,Ant,Cygwin,我需要从Cygwin shell中指定ant属性output.root,因为我无法编辑build.xml。目前,我正在尝试导出一个环境变量,如 导出输出。root=“/d/output” 但这给了我一个错误: 导出:`output.root=/d/output':不是有效的标识符 我做错了什么?标识符中只允许使用ASCII字母数字字符和下划线。必须从变量名中删除,或将其替换为 更新 Ant属性不是shell变量。必须使用-D在ant的命令行中指定ant属性: ant -Doutput.root=
output.root
,因为我无法编辑build.xml
。目前,我正在尝试导出一个环境变量,如
导出输出。root=“/d/output”
但这给了我一个错误:
导出:`output.root=/d/output':不是有效的标识符
我做错了什么?标识符中只允许使用ASCII字母数字字符和下划线。必须从变量名中删除
,或将其替换为
更新
Ant属性不是shell变量。必须使用-D
在ant
的命令行中指定ant属性:
ant -Doutput.root="/d/output" target1
要从命令行设置ant属性,应使用以下语法
ant -D<property>=<value> [target [target2 [target3] ...]]
ant-D=[target[target2[target3]…]
引用:.您是否试图从命令行设置Java属性?ant使用此属性。我无法编辑build.xml文件。这就是我需要设置它的原因。这个prorerty被ant使用。我不能改变它的名字