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

Tolerate missing pom when jar is present #4777

Closed
wants to merge 2 commits into from

Conversation

timtebeek
Copy link
Contributor

What's changed?

Catch a failure to download a pom in ResolvedPom, and if caught check to see if the corresponding jar can be found. If so, continue without issue.

What's your motivation?

Anything in particular you'd like reviewers to focus on?

  • The MavenArtifactDownloader had previously been unused for quite a while; figured to bring that back here to check for jar availability. We could possibly move that to the same package as MavenPomDownloader, such that we don't need:
  • the visibility of MavenPomDownloader.distinctNormalizedRepositories changed to public, as we need to look across all repositories for the .jar file. Not just the ones defined in the ResolvedPom.

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

There is an alternative implementation in

That chose the route of having changes mostly in MavenPomDownloader, which then also looks at jars and if so returns a dummy pom.xml; I think it's better not to mix responsibilities there, nor to continue processing a known dummy pom.

@timtebeek timtebeek added bug Something isn't working enhancement New feature or request labels Dec 12, 2024
@timtebeek timtebeek self-assigned this Dec 12, 2024
@timtebeek timtebeek mentioned this pull request Dec 12, 2024
3 tasks
@timtebeek
Copy link
Contributor Author

We likely need a mix of the approach (or at least the tests) seen here and in #4738; as right now we repeatedly attempt to download the same pom, because the failure to resolve is not stored in the pom cache.

@timtebeek
Copy link
Contributor Author

@timtebeek timtebeek closed this Dec 12, 2024
@timtebeek timtebeek deleted the tolerate-missing-pom-when-jar-is-present branch January 3, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

openrewrite maven recipes shoudn't try to resolve every single pom
1 participant