jenkinsci / plugin-pom

Parent POM for Jenkins Plugins
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
MIT License
66 stars 75 forks source link

Integrate OpenRewrite #804

Open jglick opened 12 months ago

jglick commented 12 months ago

https://github.com/openrewrite/rewrite-jenkins looks like a good place to keep rules for updating Jenkins plugin (also see https://github.com/openrewrite/rewrite-jenkins/issues/6). Yet https://docs.openrewrite.org/running-recipes/getting-started#step-2-add-rewrite-maven-plugin-or-rewrite-gradle-plugin-to-your-project and https://docs.openrewrite.org/running-recipes/getting-started#step-3-activate-a-recipe indicate that it is not ready to run out of the box. It would be great if any plugin using a sufficiently new parent were preconfigured to activate all relevant recipes so you could

mvn rewrite:run

without further ado.

(Of course there is a minor “chicken-and-egg” issue that in order to get access to https://github.com/openrewrite/rewrite-jenkins/blob/c15eac724e2c66ff956926f5966177995f035472/src/main/resources/META-INF/rewrite/rewrite.yml#L24C1-L28 you would first need to manually update your parent, but I think that is acceptable.)

Possibly depends on https://github.com/openrewrite/rewrite-jenkins/issues/4 (@sghill).

sghill commented 12 months ago

Nice, this is exciting! I also opened a few modernization PRs today with OpenRewrite through the Moderne SaaS

Very cool stuff here - bumping jenkins.version and keeping the plugins bom in sync, removing defunct properties like java.level, only adding the plugins bom if a dependency in it is present

basil commented 10 months ago

Workaround: mvn org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.activeRecipes=org.openrewrite.jenkins.ModernizePlugin -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-jenkins:0.2.0