【问题标题】:ant fails unknown argument: -buildfile=build.xmlant 失败未知参数:-buildfile=build.xml
【发布时间】:2014-08-01 15:18:27
【问题描述】:

这个问题可能是一个基本问题,但我不确定为什么会出现此错误: 未知参数:-buildfile=build.xml 尝试在 shell 脚本中运行 ant 时。

我正在使用:
Ant 版本:1.9.3
操作系统:Linux
Java 版本 : 1.7.0_65

我正在尝试在 shell 脚本文件中运行 ant,如下所示:
蚂蚁 -Dfile1=file1 -Dfile2=file2 -buildfile=build.xml -verbose.

感谢和问候,
维杰·雷迪。

【问题讨论】:

    标签: java xml shell ant


    【解决方案1】:

    来自Running Apache Ant

    ant [options] [target [target2 [target3] ...]]
    
    Options:
    ...
    -buildfile <file>      use given buildfile
    

    所以-buildfile&lt;file 之间不应该有=,而是space

    代替你的:

    ant -Dfile1=file1 -Dfile2=file2 -buildfile=build.xml -verbose
    

    试试:

    ant -Dfile1=file1 -Dfile2=file2 -buildfile build.xml -verbose
    

    【讨论】:

      猜你喜欢
      • 2019-03-04
      • 2012-06-18
      • 1970-01-01
      • 1970-01-01
      • 2011-06-19
      • 2012-07-31
      • 1970-01-01
      • 2022-06-18
      • 2012-06-02
      相关资源
      最近更新 更多