Preventing the addition of a version tag on a direct dependency for scenarios where the local parent had the managed dependency that we were also changing. Also prevented property creation that could cause breakages of other managed dependencies inherited from parent. #6566
+424
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed?
ChangeDependencyGroupIdAndArtifactId, where we'd also be updating the managed dependency, and the managed dependency lives in a parent POM (that is within the repo), it will now be prevented from also adding the version tag to the direct dependency because it should be getting inherited from the managed dependency in the parent.ChangeDependencyGroupIdAndArtifactIdorChangeManagedDependencyGroupIdAndArtifactId, it will now prevent the creation of a local POM property when changing a tag value forgroupId,artifactIdorversion, even if the resolved POM would have known about the property being used, provided the requested POM would not have known about it.What's your motivation?
doAfterVisit(..), the updated POM for the parent would not be visible at the time of deciding whether to add aversiontag to your direct dependency.groupIdandartifactId, you're no longer truly representing the same dependency anymore, and so introducing a local property to override an inherited property could cause it to break other inherited managed dependencies or direct dependencies also relying on inherited properties. Note that this doesn't affect altering of already existing properties in use by multiple dependencies. That will have to be a different change.Other considerations
Checklist