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

MNG-6759: Fix issue where MavenMetadataSource failed to set the right… #294

Merged
merged 1 commit into from Nov 17, 2019

Conversation

srdo
Copy link
Contributor

@srdo srdo commented Oct 12, 2019

… repositories when preparing artifact metadata

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Please see the issue description at https://issues.apache.org/jira/browse/MNG-6759. The basic issue is that when there's a dependency graph like A -> B -> C, and C is in some non-Central repository listed by B's POM, Maven is supposed to look for it in the repositories listed by B. As of 3.6.2, this doesn't always happen.

The issue is caused by an oversight in d3ace78. When the optimization is triggered, the "pomRepositories" variable is not set. In the slow path, it will be set to the remoteRepositories of the parent artifact in the dependency trail.

I'd like advice on improving this fix, as I'm using a deprecated method which is probably not a good idea. The optimized path gets the Model of the artifact. I need a list of ArtifactRepository, but the Model only contains a list of Repository. Should I use a RepositorySystem to map them? It feels like a waste, as they already exist in the session's set of MavenProject. I'd get them from the ReactorReader, but it unfortunately only exposes the Model.

…ght repositories when preparing artifact metadata
@srdo
Copy link
Contributor Author

srdo commented Oct 12, 2019

There's another issue related to this one, which is also introduced in the linked commit. I don't know if it's a big deal. Would appreciate if someone more familiar with Maven would consider it.

When the optimized path is hit, the relocatedArtifact variable at https://github.com/apache/maven/pull/294/files#diff-e24970dce03124cc7d88af538539cf07R181 does not get set. I'm uncertain what kind of impact this may have.

@srdo srdo changed the title WIP MNG-6759: Fix issue where MavenMetadataSource failed to set the right… MNG-6759: Fix issue where MavenMetadataSource failed to set the right… Oct 19, 2019
@rfscholte rfscholte merged commit c82409a into apache:master Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants