Skip to content

Conversation

@cstamas
Copy link
Member

@cstamas cstamas commented Nov 19, 2025

New opt-in experimental feature for enhanced local repository: ability to choose "repository key" function. Local repository (simple and enhanced) by default uses the simple key (historically) where other places all used nid. Have to note, that simple is technically equivalent to nid as RemoteRepository.isRepositoryManager() is not set anywhere in Maven.

Added key functions:

  • simple -> the original code in LRM
  • nid -> norm(id) (path friendly)
  • hurl -> sha1(url)
  • nid_hurl -> norm(id)-sha1(url)
  • gurk -> norm(id)-sha1(seed) where "seed" is all config properties of repo
  • ngurk -> norm(id)-sha1(seed) where "seed" is all config sans mirror list (just the string "isMirrored" is added for mirrors)

Introduced RepositoryKeyFunction type, that is used consistently in enhanced local repository (availability calculation), prefix composer (split repository prefix calculation) and remote repository manager (remote repository consolidation). This is new SPI, and impl provides default implementation with those above.

New opt-in feature for enhanced local repository: produce
globally unique repository keys.

WIP
@cstamas cstamas self-assigned this Nov 19, 2025
@cstamas cstamas marked this pull request as ready for review November 20, 2025 17:56
@cstamas cstamas added this to the 2.0.14 milestone Nov 20, 2025
@cstamas cstamas added the enhancement New feature or request label Nov 20, 2025
@cstamas cstamas changed the title GURK Introduce repository-key function and make it consistently used Nov 27, 2025
@gnodet
Copy link
Contributor

gnodet commented Nov 27, 2025

New opt-in experimental feature for enhanced local repository: ability to choose "repository key" function. Local repository (simple and enhanced) by default uses the simple key (historically) where other places all used nid. Have to note, that simple is technically equivalent to nid as RemoteRepository.isRepositoryManager() is not set anywhere in Maven.

Added key functions:

  • simple -> the original code in LRM
  • nid -> norm(id) (path friendly)
  • hurl -> sha1(url)
  • nid_hurl -> norm(id)-sha1(url)
  • gurk -> norm(id)-sha(seed) where "seed" is all config properties of repo
  • ngurk -> norm(id)-sha(seed) where "seed" is all config sans mirror list (just the string "isMirrored" is added for mirrors)

Fwiw, since this is switching to a more mathematical expression, I was confused by the - which, when I first read, though it was minus. I wonder if we could use a different separator such as + or ..

@cstamas cstamas changed the title Introduce repository-key function and make it consistently used Repository Key Function SPI Nov 28, 2025
More as a showcase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants