openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
111 stars 75 forks source link

Revert adding SerialVersionUID #563

Closed melloware closed 2 months ago

melloware commented 2 months ago

@DidierLoiseau @timtebeek has convinced me this is bad change and leave only the @Serial in

DidierLoiseau commented 2 months ago

For reference, this follows a discussion in #560. Thanks @melloware for you reactivity.

@timtebeek, I don’t think it’s possible to downgrade rewrite-migrate-java when running the Maven plugin from the command-line without declaring the plugin in the pom, right? Would it be possible to make a new release of the plugin (with the updated bom) once this is fixed?

timtebeek commented 2 months ago

Thanks both! It's definitely possible to override just one recipe module. I'll push a patch release of this one

DidierLoiseau commented 2 months ago

@timtebeek

It's definitely possible to override just one recipe module.

without configuring the plugin in the pom?

timtebeek commented 2 months ago

Absolutely! You can do so by passing in -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:2.26.1 https://openrewrite.github.io/rewrite-maven-plugin/run-mojo.html#recipeartifactcoordinates

DidierLoiseau commented 2 months ago

@timtebeek Thanks, but actually I’m already doing that but with my own library. It seems there is an issue with the dependency resolution though, because despite my library’s dependency:tree showing rewrite-migrate-java:2.26.1 being used, it was still using 2.26.0.

It seems to be something with the <dependencyManagement>. If I force the version directly in the dependency instead (which I wasn’t declaring since the library actually depends on rewrite-spring), it seems to work.

I’ll try to create a small repro project later, but I fear that it could actually be an issue with Maven Resolver.

timtebeek commented 2 months ago

Hmm that's unfortunate; not quite sure how Maven merges conflicting plugin dependencies; perhaps there's ordering there too? So would -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:2.26.1,you.library:second:1.0.1 work?