如何写一个批处理文件来执行多个MAVEN命令

If the developer wish to run multiple mvn command line as shown below, then only first mvn command line will be getting executed and first jar file is getting installed in the local repository.

mvn install:install-file -Dfile=./myJar1.jar -DgroupId=com.test -DartifactId=myTest1 -Dversion=1.0 -Dpackaging=jar

mvn install:install-file -Dfile=./myJar2.jar -DgroupId=com.test -DartifactId=myTest2 -Dversion=1.0 -Dpackaging=jar


If we wish to get all the command line get executed, put the "call" in front of each of the command and your batch file will be looked like below.
call mvn install:install-file -Dfile=./myJar1.jar -DgroupId=com.test -DartifactId=myTest1 -Dversion=1.0 -Dpackaging=jar

call mvn install:install-file -Dfile=./myJar2.jar -DgroupId=com.test -DartifactId=myTest2 -Dversion=1.0 -Dpackaging=jar


Voila, you will get all the jar files installed in your local repository.

猜你喜欢

转载自bglmmz.iteye.com/blog/2191037
今日推荐