利用maven-help-plugin在shell中读取pom_xml的变量

安装maven-help-plugin

1
2
3
4
5
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</dependency>

读取变量

1
2
RESULT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo $RESULT

参考:

https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html

利用maven-help-plugin在shell中读取pom_xml的变量

https://hexo.terwer.space/pages/5c3039/

作者

Terwer

发布于

2022-06-19

更新于

2022-06-19

许可协议

评论