Closed josemariavillar closed 2 years ago
Thanks for reporting! We recently made some changes (in 7.23.x) to this recipe that may help with this issue:
See: https://github.com/openrewrite/rewrite/issues/1723
I think if you were to add newVersion
to your recipes:
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.apache.httpcomponents
oldArtifactId: httpclient
newGroupId: org.apache.httpcomponents.client5
newArtifactId: httpclient5
newVersion: <desired version here>
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: com.oracle.ojdbc
oldArtifactId: ojdbc8
newGroupId: com.oracle.database.jdbc
newArtifactId: ojdbc8
newVersion: <desired version here>
This recipe now uses the Maven Resolution to be a little smarter with its modifications:
newVersion
and set overrideManagedVersion
to true
, this recipe will ALWAYS include the version with the new dependency.@josemariavillar Can you confirm that this works as you would expect it with the latest snapshot? I also realize that we need to add the ability to use the semver selector for the newVersion
. (that is a really good suggestion)
Good morning, I will check it and let you know. Thank you very much.
Hi @josemariavillar ,
I am going to close this issue but if, for some reason, you find it is not working please feel free to re-open it.
Good morning,
I am having problems with the recipe 2ChangeDependencyGroupIdAndArtifactId". This problem occurs when I want to change several dependencies that are no longer defined in the new parent. For example, in the attached example, as you can see I first update the POM parent to the latest version of Spring Boot. In this version, the dependency com.oracle.ojdbc:ojdbc8 no longer exists and so I run the recipe "ChangeDependencyGroupIdAndArtifactId" to replace it with com.oracle.database.jdbc:ojdbc8.
When executing the :
The result obtained is:
And, as you can see, the recipe is not executed.
This problem occurs in version 4.22.0, as well as in version 4.23.0 of the plugin.
You can reproduce the problem in the following attached project: https://github.com/josemariavillar/test_project/tree/no-version-provided
Thank you very much for the excellent support you provide
Thanks & regards