Skip to content

set-property should add the property if it does not yet exist#1340

Open
mandritschke wants to merge 1 commit intomojohaus:masterfrom
mandritschke:issues/1268
Open

set-property should add the property if it does not yet exist#1340
mandritschke wants to merge 1 commit intomojohaus:masterfrom
mandritschke:issues/1268

Conversation

@mandritschke
Copy link
Copy Markdown

@mandritschke mandritschke commented Jan 26, 2026

Fixes #1268

  • instead of just updating existing properties allows to insert completely new properties new properties overriding properties from parent POM
  • works for properties on the project level as well as on the profile level (that is if a profile id is given)
  • though this implementation won't create new profiles at the moment, this could be a possible enhancement, let me know if this sounds useful
  • formatting was kind of a challenge

Usage

mvn org.codehaus.mojo:versions-maven-plugin:2.21.1-SNAPSHOT:set-property \
  -Dproperty=mockitoVersion \
  -DnewVersion=4.11.1 \
  -Dinsert

Notice that set-properties will be executed recursively on child modules if there are any.
If you don't want the property to be inserted into all of these child modules use the -N option.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set-property should add the property if it does not yet exist

1 participant