19

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

这是我的批处理文件:

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

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

4

1 回答 1

32

尝试更改mvn clean installcall mvn clean install.

如果mvn是另一个批处理文件,除非您使用call.

于 2012-08-02T18:04:47.507 回答