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

[EXPERIMENT] Proper remote repository scoping during dependency resolution #87

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Jan 8, 2021

Introduce new method remote repository manager to allow make possible repositories to be added not only to TAIL but also to HEAD of remote repository list.

This PR is NOT meant for merge as is, is more just an example.

result.add( repository );
if ( prepend )
{
result.add( 0, repository );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that reverse prepend?

Copy link
Member Author

@cstamas cstamas Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project model build invokes this method with "false", so all as before: the list of repositories are in same exact order as before. If your project defines prj-repo1, prj-repo2, prj-repo3 the result will be [prj-repo1, prj-repo2, prj-repo3] (let's neglect central from super pom for now, but it is last).

Now, if we call level0 the project model, and level1 the 1st sibling dependency of level0, and level2 the first sibling of level1, then: as ModelResolver is recursively being cloned/copied, and modified (by adding reposes of downloaded and parsed POMs), AND if we assume each level is adding new repo (as in my example), you will end up with these lists in different instances of ModelResolver on each level:
level1: [level1-repo, prj-repo1, prj-repo2, prj-repo3]
level2: [level2-repo, level1-repo, prj-repo1, prj-repo2, prj-repo3]
and so on.

In short, as you "dive in" recursively into resolving dependencies, you want "nearest" repo to prevail, and those are prepended to list...

Maybe the name is not clear, but that's above is the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants