如何指定要传递给Ant任务运行的java进程的文件?
我有一个Ant任务来调用在命令行上获取文件的java进程。我可以将该文件直接传递给java程序,但我不知道如何让Ant在命令行上获取该文件 以下是我得到的:如何指定要传递给Ant任务运行的java进程的文件?,java,command-line,ant,Java,Command Line,Ant,我有一个Ant任务来调用在命令行上获取文件的java进程。我可以将该文件直接传递给java程序,但我不知道如何让Ant在命令行上获取该文件 以下是我得到的: <target name="FileProcessor" description="Process a specified file"> <run-standalone name="CheckClearer" main-class="com.blah.FileProcessor"> <a
<target name="FileProcessor" description="Process a specified file">
<run-standalone name="CheckClearer" main-class="com.blah.FileProcessor">
<args>
<arg value="${file}"/>
</args>
</run-standalone>
</target>
(我到处寻找这个问题的答案,因为我确信我只是缺少了一些简单的东西,但没有找到任何东西。如果有这么一个答案,请告诉我。谢谢)我从未见过
任务,但你可以使用
启动Java类并嵌套
(根据需要,您可以设置许多不同的属性)
我从未见过
任务,但您可以使用
启动Java类并嵌套
(根据需要,您可以设置许多不同的属性)
似乎未设置文件
属性
在
...
看起来您正在使用用户定义的宏或自定义任务runstandalone
。因为它不是standad Ant的一部分,所以很难说这个特定的API需要什么。看起来好像没有设置文件
属性
在
...
看起来您正在使用用户定义的宏或自定义任务runstandalone
。因为它不是standad Ant的一部分,所以很难说出这个特定API的期望值。尝试以这种方式调用Ant:
ant FileProcessor -Dfile=<your path here>
ant文件处理器-Dfile=
尝试以这种方式调用ant:
ant FileProcessor -Dfile=<your path here>
ant文件处理器-Dfile=
在运行单机版之前,是否尝试添加文件:${file}
?是否尝试添加文件:${file}
在独立运行之前
?系统属性是从build.xml中访问ant命令行上指定值的唯一was。系统属性是从build.xml中访问ant命令行上指定值的唯一was。
<property name="file" location="/path/to/file"/>
<run-standalone>
...
</run-standalone>
ant FileProcessor -Dfile=<your path here>