Example Analysis of BAT script calling maven Command
This article will explain in detail about BAT script call maven command example analysis, Xiaobian think quite practical, so share for everyone to make a reference, I hope you can have some harvest after reading this article.
Recently encountered a problem, because there are a lot of local libraries need to be installed, the dependency method used before is system, because it cannot be automatically introduced at the time of package.
org.zhixun IKAnalyzer 1.0 system ${basedir}/../ parent/libs/IKAnalyzer3.2.3Stable.jar
Therefore, you need to create a batch script that automatically installs:
mvn install:install-file -DgroupId=org.zhixun -DartifactId=IKAnalyzer -Dversion=3.2.3 -Dpackaging=jar -Dfile=libs/IKAnalyzer3.2.3Stable.jar
However, it always exits automatically after executing an mvn target. The pause command is also invalid. The analysis reason is that mvn itself is a bat command. Therefore, when exiting, the entire script process will exit. Add the call command to call it.
@echo off set localdir=%~dp0 call mvn install:install-file -DgroupId=org.zhixun -DartifactId=IKAnalyzer -Dversion=3.2.3 -Dpackaging=jar -Dfile=%localdir%/libs/IKAnalyzer3.2.3Stable.jar pause This article is shared here. I hope the above content can help you to learn more. If you think the article is good, please share it for more people to see.