如何传递参数给Maven构建使用pom.xml的? [英] How to pass parameters to maven build using pom.xml?

查看:2630
本文介绍了如何传递参数给Maven构建使用pom.xml的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想Maven的命令行参数传递到pom.xml的,这样我可以使用这些值在建设目的其他用途。

I wanted pass maven command line parameter to POM.xml so that i can use those value for some other purpose in building purpose.

推荐答案

我们可以一些搜索,我发现了一些有用的

We can Supply parameter in different way after some search I found some useful

<plugin>
  <artifactId>${release.artifactId}</artifactId>
  <version>${release.version}-${release.svm.version}</version>...

...

其实在我的应用程序需要提供SVN版本保存并作为参数,所以我必须如上实现的。

Actually in my application I need to save and supply SVN Version as parameter so i have implemented as above .

在运行构建,我们需要提供价值的参数如下:

While Running build we need supply value for those parameter as follows.

RestProj_Bizs>mvn clean install package -Drelease.artifactId=RestAPIBiz -Drelease.version=10.6 -Drelease.svm.version=74

下面我提供

release.artifactId=RestAPIBiz
release.version=10.6
release.svm.version=74

这为我工作。
谢谢

It worked for me. Thanks

这篇关于如何传递参数给Maven构建使用pom.xml的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆