0

I have an internal library and I put the actual version in the property section.

<properties>
    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <springfox-version>2.5.0</springfox-version>
    <common.version>6.0.3-SNAPSHOT</common.version>
</properties>

I want to automate the release process so in my Jenkins pipeline script, I would like to be able to run a command and update the 'common.version' to whatever the user entered as parameter.

When I run:

mvn versions:update-property -Dproperty=common.version -DnewVersion=[6.0.3] -DallowSnapshots=true

I get:

[INFO] Property ${common.version}: Leaving unchanged as 6.0.3-SNAPSHOT

What am I missing?

iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169
  • Possible duplicate of [How can I update a property in a Maven POM?](https://stackoverflow.com/questions/25034556/how-can-i-update-a-property-in-a-maven-pom) (AFAICT you will probably want to use the second most-upvoted answer) – Aaron Jul 30 '18 at 14:32
  • im on mvn 3.3, when i run setproperty, i get error, something something could not find goal – iCodeLikeImDrunk Jul 30 '18 at 15:33
  • Hmm, maybe `versions:set` instead? https://www.mojohaus.org/versions-maven-plugin/set-mojo.html ; set-properties doesn't seem to exist anymore. – Aaron Jul 30 '18 at 15:48
  • the set will change the projects vresion, not the specific property that i want :( – iCodeLikeImDrunk Jul 30 '18 at 16:53

0 Answers0