GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove unnecessary repository preparation in metadata resolution for prefixes by slawekjaranowski · Pull Request #1830 · apache/maven-resolver

Conversation

@slawekjaranowski

@slawekjaranowski slawekjaranowski commented Apr 14, 2026

Copy link
Copy Markdown
Member

Repository should be already configured, it is too late to change configuration. The same configuration should be used for standard operation and resolving metadata.

Example: plugins can provide unconfigured repo,
when we have configuration for mirror in settings - mirror will be used only for metadata.


Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

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.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slawekjaranowski
Remove unnecessary repository preparation in metadata resolution for …
d5a3aea
…prefixes

Repository should be already configured, it is too late to change configuration.
The same configuration should be used for standard operation and resolving metadata.

Example: plugins can provide unconfigured repo,
when we have configuration for mirror in settings - mirror will be used only for metadata.
@slawekjaranowski
slawekjaranowski requested a review from cstamas April 14, 2026 19:18
@slawekjaranowski slawekjaranowski self-assigned this Apr 14, 2026
@slawekjaranowski slawekjaranowski added the bug Something isn't working label Apr 14, 2026
@cstamas

cstamas commented Apr 14, 2026

Copy link
Copy Markdown
Member

Example: plugins can provide unconfigured repo,
when we have configuration for mirror in settings - mirror will be used only for metadata.

Are you sure about this? This sounds wrong...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Example: plugins can provide unconfigured repo,
when we have configuration for mirror in settings - mirror will be used only for metadata.

Are you sure about this? This sounds wrong...

I discovered it by using wildfly-maven-plugin, which manually add repsitories:

https://github.com/wildfly/wildfly-maven-plugin/blob/3c924bc6d07cccd3954dfd28811364044c1f2f7a/core/src/main/java/org/wildfly/plugin/core/MavenRepositoriesEnricher.java

only proxy is configured here (also manually),

I have configured mirrors in my settings.

I such case in normal resolutions, mirrors are not used ... but for prefixes metadata we add mirror ...

My debug session show:

image
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

Why we need to reconfigure repo ... it should be already done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cstamas

cstamas commented Apr 14, 2026

Copy link
Copy Markdown
Member

See https://github.com/apache/maven-resolver/blob/master/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java#L312

In fact, see whole Resolver API: all methods references this method above. This is resolver expectation. IF user has set up mirror, it has to be obeyed, I cannot today, but pls ping me on Slack tomorrow to discuss this.

slawekjaranowski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

I know that newResolutionRepositories should be used .... but what if autor of plugin doesn't use it? it is my case.

When repo is correctly created with newResolutionRepositories it will be configured and we don't want to do it again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cstamas

cstamas commented Apr 15, 2026

Copy link
Copy Markdown
Member

That is clearly a bug then. In 90% of cases, when plugin operates on received repositories, Maven already primed them. But, if plugin creates new RemoteRepository instances, that is a bug.

Moreover, the method newResolutionRepositories is not and cannot be idempotent, hence, we (resolver) cannot just invoke that method over and over again, as it will create issues with setups like mirrorOf: *.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

I agree that it is a bug in plugin .... but I think that next reconfiguration is not required
and introduce some of inconsistency

when use such repo for standard resolving we use it as is
when used for resolving meta-data we change configuration

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

So if:

Moreover, the method newResolutionRepositories is not and cannot be idempotent, hence, we (resolver) cannot just invoke that method over and over again, as it will create issues with setups like mirrorOf: *.

we also should not call aggregateRepositories

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cstamas
cstamas approved these changes Apr 16, 2026
View reviewed changes

@cstamas cstamas left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Right, is correct. I use "normalized" bare reposes only as keys.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas
cstamas merged commit b44db28 into apache:master Apr 16, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 2.0.17 milestone Apr 16, 2026
@slawekjaranowski
slawekjaranowski deleted the prefixes-metadata-config branch April 23, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@slawekjaranowski slawekjaranowski

Labels

bug Something isn't working

Projects

None yet

Milestone

2.0.17

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@slawekjaranowski @cstamas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.