In Maven, how can I dynamically build a property value at runtime?

前端 未结 3 1039
盖世英雄少女心
盖世英雄少女心 2020-12-03 10:50

In maven it is very easy to set properties in a pom with the following syntax:

...

  4.06.17.6
          


        
3条回答
  •  情深已故
    2020-12-03 11:05

    Ihor Kaharlichenko's answer is basically correct except that it copies an error from the Codehaus documentation. There should be no '\' between the '$' and the '{'. The mojo works without it and doesn't work with it. Truly, with a basic understanding of regex and Maven, I couldn't see what the backslash was supposed to do and indeed it's wrong.

    Stephen Connolly's answer correctly omits the backslash. Be careful.
    This error has proliferated throughout SO and with Codehaus out of business will probably never get fixed.

提交回复
热议问题