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

UpgradePluginVersion -- ability to upgrade maven plugin version #579

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

aegershman
Copy link
Contributor

@aegershman aegershman commented May 26, 2021

see: #570
see downstream issue which prompted this: openrewrite/rewrite-quarkus#6
see: #585

This code looks wonky, I know. It's loosely based on upgradePluginDependency. Would be enhanced by virtue of having pom and maven model supports pluginManagement

In order to enable upgrading a maven plugin to a different version, include a recipe for specifying a version to upgrade a plugin to a later version.

@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch from 05a03f6 to 17f49ad Compare May 26, 2021 20:39
@aegershman aegershman changed the title Ability to upgrade maven plugin version UpgradePluginVersion -- ability to upgrade maven plugin version May 26, 2021
@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch from 17f49ad to ca14620 Compare May 27, 2021 01:43
@aegershman aegershman added the enhancement New feature or request label May 27, 2021
@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch 2 times, most recently from 3d3587c to 105dc35 Compare May 29, 2021 04:45
@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch from 105dc35 to 34c0322 Compare June 4, 2021 16:50
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2021

Unit Test Results

   428 files  ±0     428 suites  ±0   4m 15s ⏱️ ±0s
2 077 tests ±0  2 047 ✔️ ±0  30 💤 ±0  0 ❌ ±0 
2 953 runs  ±0  2 913 ✔️ ±0  40 💤 ±0  0 ❌ ±0 

Results for commit e56686a. ± Comparison against base commit e56686a.

♻️ This comment has been updated with latest results.

@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch 6 times, most recently from e45173b to 535b0d5 Compare June 9, 2021 04:16
@aegershman aegershman marked this pull request as ready for review June 9, 2021 17:31
@aegershman aegershman requested a review from tkvangorder June 9, 2021 17:32
Copy link
Contributor

@tkvangorder tkvangorder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good Aaron, my only suggestion would be to move the "maybeChangeVersion" logic to an applicability test (a visitor that marks up the tree if a change will be made).

}

@Override
public Maven visitMaven(Maven maven, ExecutionContext ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking we can move the logic for finding if we are going to make a change to the applicability test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented an applicability test which simply checks for the existance of the desired plugin to upgrade. I fully expect for this entire visitor to be cleaned up to be more efficient, though the API for it's usage (options) should be stable, and it does work (assuming you aren't trying to get a version from pluginManagement, etc.). But, it does work. Forgive me for this, but I'm going to merge it knowing full-well it could use more love 😬

@aegershman aegershman added this to the 7.7.0 milestone Jun 10, 2021
@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch 3 times, most recently from b604b38 to 3d94cf4 Compare June 10, 2021 18:15
@aegershman aegershman force-pushed the upgrade-maven-plugin-version branch from 3d94cf4 to 04e45da Compare June 10, 2021 18:28
@aegershman aegershman merged commit e56686a into main Jun 10, 2021
@aegershman aegershman deleted the upgrade-maven-plugin-version branch June 10, 2021 18:45
knutwannheden pushed a commit that referenced this pull request Mar 4, 2025
…ings (#579)

* Fix issue 568, trailing semi-colon on property accessor without surroundings

* polish

* clean up warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants