Skip to content

Enhancement: set-property update value in a specific profile #911

Closed
@mcarlett

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions