Set plugin's property on the command line in maven 2

后端 未结 4 1285
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 23:28

In maven 2.x, how would one set a plugin\'s property on the command line instead of in the of that plugin in the pom or in settings.xml?

For exampl

4条回答
  •  臣服心动
    2021-02-07 00:11

    Define the properties as arbitrary properties ... not the standard maven props such as version. In my case I defined a new property build.version:

     build.version=unknown 
    

    I use the property:

    ${build.version}
    

    I define the property:

    mvn -P prod -Dbuild.version=app_name-branch_name-build_number package
    

提交回复
热议问题