Enhancement: set-property update value in a specific profile #911
Closed
Description
opened on Jan 26, 2023
When I run mvn versions:set-property -Dproperty=myProp -DnewVersion=newPropVal
the value of the property in the pom.xml will be set as expected, but if I have the same property overridden in a specific profile, I cannot set that specific property in the profile, keeping the value as it is in the project properties section.
Example:
If I have
`
<properties>
<dummy-api-version>1.0.0</dummy-api-version>
</properties>
<profiles>
<profile>
<id>test-profile</id>
<properties>
<dummy-api-version>test-value</dummy-api-version>
</properties>
</profile>
</profiles>
`
And I run mvn versions:set-property -Dproperty=dummy-api-version -DnewVersion=2.0.0
the result will be
`
<properties>
<dummy-api-version>2.0.0</dummy-api-version>
</properties>
<profiles>
<profile>
<id>test-profile</id>
<properties>
<dummy-api-version>test-value</dummy-api-version>
</properties>
</profile>
</profiles>
`
but what it I want to update the value test-value
in the profile test-profile
?
I'm expecting that running something like mvn versions:set-property -Dproperty=dummy-api-version -DnewVersion=2.0.0 -DprofileId=test-profile
will produce
`
<properties>
<dummy-api-version>1.0.0</dummy-api-version>
</properties>
<profiles>
<profile>
<id>test-profile</id>
<properties>
<dummy-api-version>2.0.0</dummy-api-version>
</properties>
</profile>
</profiles>
`
Activity