从一个批处理文件运行ant:后来的命令不运行 [英] Running ant from a batch file: Later commands don't run

查看:154
本文介绍了从一个批处理文件运行ant:后来的命令不运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行蚂蚁,然后拷贝制作的文件中的一个批处理文件:

I have a batch file that runs ant and then copies one of the files that were produced:

ant -Dproject.version=1.1.2 release published
copy /Y D:\dir1\MyJar.jar   D:\dir2\MyJar.jar

当我运行该批处理文件,蚂蚁成功运行,但复制声明不会发生,但它会工作,如果我键入它只是罚款,然后按Enter Ant任务完成后。

When I run the batch file, ant runs successfully, but the copy statement never happens, although it will work just fine if I type it in and hit Enter after the ant task has finished.

这是怎么回事呢?

推荐答案

我有同样的问题一次,魔术呼叫做到了。

I had the same problem once and the magic call did it.

在你的那个批处理文件试试:

In that batch file of yours try:

call ant -Dproject.version=1.1.2 release published
copy /Y D:\dir1\MyJar.jar   D:\dir2\MyJar.jar

不能告诉你为什么它的工作,虽然。猜猜它是微软的逻辑。

Cannot tell you why it worked, though. Guess it's Microsoft logic.

这篇关于从一个批处理文件运行ant:后来的命令不运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆