如何执行比BAT文件中的一个Maven的命令吗? [英] How to execute more than one maven command in bat file?

查看:171
本文介绍了如何执行比BAT文件中的一个Maven的命令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个bat文件,如:

I made a bat file like:

mvn clean;
mvn package;

,但它不工作,仅执行第一命令

but it doesn't work, only the first command is executed.

有人可以帮我吗?

推荐答案

使用

call mvn clean
call mvn package

请注意,您不需要在批处理文件分号。以及为什么你需要使用呼叫的原因是, MVN 本身是一个批处理文件,批处理文件需要调用每个其他与呼叫,否则控制不返回给调用者。

Note that you don't need semicolons in batch files. And the reason why you need to use call is that mvn itself is a batch file and batch files need to call each other with call, otherwise control does not return to the caller.

这篇关于如何执行比BAT文件中的一个Maven的命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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