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
使用Ant时要执行的Netbeans build.xml_Ant_Build_Execute_Build.xml - Fatal编程技术网

使用Ant时要执行的Netbeans build.xml

使用Ant时要执行的Netbeans build.xml,ant,build,execute,build.xml,Ant,Build,Execute,Build.xml,我对使用构建文件和Ant从命令行编译和执行相对较新,因此我想知道如何修改从netbeans自动生成的build-impl.xml文件,以便在编译后也执行程序 目前,当我在列出build.xml文件的命令窗口中键入“ant”时,它会编译,等等,然后说 -do-jar-copylibs: [copylibs] Nothing to copy. [echo] To run this application from the command line without Ant, try:

我对使用构建文件和Ant从命令行编译和执行相对较新,因此我想知道如何修改从netbeans自动生成的build-impl.xml文件,以便在编译后也执行程序

目前,当我在列出build.xml文件的命令窗口中键入“ant”时,它会编译,等等,然后说

-do-jar-copylibs:
 [copylibs] Nothing to copy.
     [echo] To run this application from the command line without Ant, try:
     [echo] java -jar "C:\Users\Eric\Documents\Word Documents\Java Test Code\NetbeansVersion\Cops\dist\Cops.jar"
我可以运行这个命令,它会运行得很好,但我希望程序只需键入ant即可执行

build.xml文件-

Build-impl.xml文件-

在ant中有几个“任务”可以用来完成这项任务

您可以使用以下任一选项: ,

这些文档页还提供了示例。但是,在开始之前,您可能希望从开始了解ant构建文件的结构,以确定要在何处以及如何添加此执行步骤

让您的构建脚本执行程序让我感觉有点“不舒服”,但我相信您一定有原因,因此我可能建议添加一个执行构建步骤的新目标,然后还运行此命令来启动程序。这样,您仍然可以选择在不运行程序的情况下运行构建