How can I update a property in a Maven POM?

后端 未结 7 683
耶瑟儿~
耶瑟儿~ 2020-12-13 18:23

I have two top-level Maven projects, backend and frontend, that advance versions at their own individual pace. Since each has multiple modules, I d

7条回答
  •  清歌不尽
    2020-12-13 19:05

    The newVersion parameter is badly documented (as is most of this plugin). By checking the integration tests, I see it takes a Maven version range not a simple version number. Also, it does not allow you to provide any value - it must be a valid one that Maven can resolve. The parameter would be better if it was called constrainRange

    For anyone else in future, try this:

    mvn versions:update-property -Dproperty=frontend.version -DnewVersion=[0.13.2]  
    

    If you need to update to a snapshot make sure you set the property allowSnapshots to true

    mvn versions:update-property -Dproperty=frontend.version -DnewVersion=[0.13.2] -DallowSnapshots=true
    

提交回复
热议问题