Skip to content

Conversation

@maxandersen
Copy link
Member

@maxandersen maxandersen commented Nov 15, 2019

When resolver tests was running they got affected by users local repo causing test assumptions to fail.

this fix explcilty set the local repo home during tests rather than listen to global default that makes behvaior different between machines that runs them.

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

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

Let's use repoHome everywhere.

final MavenLocalRepositoryManager appCreatorLocalRepoManager = new MavenLocalRepositoryManager(
repoSystem.newLocalRepositoryManager(newSession, new LocalRepository(builder.repoHome.toString())),
Paths.get(MavenRepoInitializer.getLocalRepo(MavenRepoInitializer.getSettings())));
builder.localRepoHome==null ? Paths.get(MavenRepoInitializer.getLocalRepo(MavenRepoInitializer.getSettings())) : builder.localRepoHome);
Copy link
Member

Choose a reason for hiding this comment

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

I think it should just be builder.repoHome.

Copy link
Member Author

Choose a reason for hiding this comment

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

but then you are using the same dir as the remote repository and the local cache. Maven treats that differently internally.

if you as a user want it to be the same you should just do that when calling the builder.

Copy link
Member

Choose a reason for hiding this comment

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

There is no remote repo here. This is a local repo config. Now that I'm looking into how it's implemented, the benefit of having a delegate was that installed artifacts would end up in repoHome instead of the user local one. That was useful for me at the time.
We could keep this as a feature but it shouldn't be the default behavior.

I propose to remove localRepoHome and introduce a boolean e.g. fallbackToUserRepo which if set to true (the default should be false) would trigger the current behavior, otherwise repoHome should be used as the only local repo.

Copy link
Member

Choose a reason for hiding this comment

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

i.e. this should be the default local repo manager if repoHome isn't null: repoSystem.newLocalRepositoryManager(newSession, new LocalRepository(builder.repoHome.toString()))

Copy link
Member

Choose a reason for hiding this comment

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

if the user wants delegation then its the current new MavenLocalRepositoryManager( repoSystem.newLocalRepositoryManager(newSession, new LocalRepository(builder.repoHome.toString())), Paths.get(MavenRepoInitializer.getLocalRepo(MavenRepoInitializer.getSettings())));

Copy link
Member Author

Choose a reason for hiding this comment

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

as long as you are sure we are not by accident changing maven resolutoin logic for everything else but this one test then i'm fine - if unsure i suggest we keep the change for 1.0 absolute minimal and then in 1+ look at change the logic.

Copy link
Member

Choose a reason for hiding this comment

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

I'm sure.

… repo as a fallback one for the failed artifact resolving requests in case it was setup with a custom local repo path. A new config option reTryFailedResolutionsAgainstDefaultLocalRepo was introduced on its builder to support the fallback behavior.
@aloubyansky
Copy link
Member

@gsmet i updated this one

@gsmet gsmet changed the title ensure resolver tests runs unaffected by local ~/.m2 repo Ensure resolver tests runs unaffected by local ~/.m2 repo Nov 18, 2019
@gsmet gsmet dismissed aloubyansky’s stale review November 18, 2019 10:17

Alexey made the changes.

@gsmet gsmet merged commit ceb4ed1 into quarkusio:master Nov 18, 2019
@gsmet gsmet added this to the 1.0.0.Final milestone Nov 18, 2019
@gsmet gsmet removed the backport? label Nov 18, 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

Development

Successfully merging this pull request may close these issues.

3 participants