Igo*_*hin 1 windows command-line maven
Linux 也回答了同样的问题 - How to get Maven project version to the bash command line
但是 Windows 呢?
在命令行中为我工作:
mvn -q --non-recursive "-Dexec.executable=cmd" "-Dexec.args=/C echo ${project.version}" "org.codehaus.mojo:exec-maven-plugin:1.3.1:exec"
Run Code Online (Sandbox Code Playgroud)
在批处理文件中:
for /f %%i in ('call mvn -q --non-recursive "-Dexec.executable=cmd" "-Dexec.args=/C echo ${project.version}" "org.codehaus.mojo:exec-maven-plugin:1.3.1:exec"') do set PVERSION=%%i
echo %PVERSION%
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1551 次 |
| 最近记录: |