gpt4 book ai didi

maven - 为什么批处理中的一组命令在仅运行某些命令后往往会停止?

转载 作者:行者123 更新时间:2023-12-01 19:35:42 25 4
gpt4 key购买 nike

我的批处理文件的目标是执行“mvn clean install”,将一些环境文件复制到某处,然后启动本地主机服务器。

这是我的批处理文件:

REM # change the following dirs accordingly
set webapp_dir=C:\cygwin\home\git\new_trunk
echo "moving to webapps project dir"
cd %webapp_dir%
echo "mvn clean install"
mvn clean install

---------------------it seems to finish the maven install then just stops
---------------------------i dont really wanna write 2 batch files just for this

set env_dir=C:\cygwin\home\git\new_trunk\etc\environment\dev\yao
set class_dir=C:\cygwin\home\git\new_trunk\webapps-dist\target\classes
cd %env_dir%
copy /y env.conf.bat %class_dir%
echo "copying env.conf file"

msg * maven install complete, the env.conf has been copied

set run_dir=C:\cygwin\home\git\new_trunk\webapps-dist\target\classes\jboss-as\bin
cd %run_dir%
echo "starting the server, run server 0.0.0.0"
run.bat -c server -b 0.0.0.0

当我说停止时,我的意思是 this那么有没有一种方法可以在一个批处理文件中运行这里的所有内容?

最佳答案

尝试将mvn clean install更改为call mvn clean install

如果 mvn 是另一个批处理文件,控制权不会返回到原始批处理文件,除非您使用 call 显式调用它。

关于maven - 为什么批处理中的一组命令在仅运行某些命令后往往会停止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11783144/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com