spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

Revamp/1002 mavenartifactdownloader should interpret relocations

Open fabapp2 opened this issue 1 year ago • 1 comments

Debugging the dependency resolution showed that:

  • The URI for dependencies is built in MavenArtifactDownloader
  • The URI always points to the jar dependency
  • This results in a broken URL for relocated dependencies like java:mysql-connector-java:8.0.33
  • To fix this in the ArtifactDownloader the downloadArtifact() method would need to be refactored
    • One solution might be to check the (previously) downloaded pom when the download returned a 404.
    • And if a relocation is found use the relocation-information from the pom and try another download
  • Another solution would be a general recipe (https://github.com/openrewrite/rewrite-java-dependencies/issues/58)
  • A temporary fix for SpringPetclinic Upgrade recipe from 2.5 - 2.6 would solve it for the given application (but not for others)

See https://github.com/openrewrite/rewrite-java-dependencies/issues/58

fabapp2 avatar Nov 21 '23 09:11 fabapp2

You might be interested to see the work done in this PR to parse & match a list of relocated artifacts

  • https://github.com/openrewrite/rewrite-java-dependencies/pull/59

timtebeek avatar Jan 20 '24 21:01 timtebeek