Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mcarlett opened this issue Jan 26, 2023 · 3 comments · Fixed by #912
Closed

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

mcarlett opened this issue Jan 26, 2023 · 3 comments · Fixed by #912
Milestone

Comments

@mcarlett
Copy link
Contributor

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>

`

mcarlett added a commit to mcarlett/versions that referenced this issue Jan 26, 2023
Add profileId property to manage the property value to set
@mcarlett
Copy link
Contributor Author

the above commit is a solution to add this feature

@slawekjaranowski
Copy link
Member

@mcarlett please create a PR

@mcarlett
Copy link
Contributor Author

mcarlett commented Jan 27, 2023

@slawekjaranowski done, thanks #912

@slawekjaranowski slawekjaranowski linked a pull request Feb 1, 2023 that will close this issue
@slawekjaranowski slawekjaranowski added this to the 2.15.0 milestone Feb 1, 2023
slawekjaranowski pushed a commit that referenced this issue Feb 2, 2023
Add profileId property to manage the property value to set
jarmoniuk pushed a commit to jarmoniuk/versions-maven-plugin that referenced this issue Feb 13, 2023
Add profileId property to manage the property value to set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants