slachiewicz opened a new pull request, #1418:
URL: https://github.com/apache/maven-scm/pull/1418

   Adds `BasicScmManager.fromServiceLoader(ClassLoader)`, which builds a 
populated `ScmManager` without a Sisu container, and registers the five 
providers for `ServiceLoader`. Closes #1417.
   
   - Providers are keyed by their `@Named` value (`javax.inject` or 
`jakarta.inject`, read reflectively because maven-scm-api has no `javax.inject` 
dependency), the same key Sisu uses, so `git` and `jgit` stay distinct. A 
provider without `@Named` falls back to its SCM type.
   - A provider that cannot be loaded, for example the jgit provider without 
JGit on the class path, is skipped with a warning, as Sisu skips a bean it 
cannot load. The other providers are still registered.
   - `JGitScmProvider` gets a public no-arg constructor for `ServiceLoader`. It 
never prompts: credential items that need input are refused, and informational 
messages are dropped. The `@Inject` constructor is unchanged, so Sisu users 
keep the interactive prompter. Like the Sisu route, which also instantiates 
every provider, creating the jgit provider sets JGit's default 
`CredentialsProvider`.
   - The Sisu index files are unchanged.
   - The test sits in maven-scm-client because it is the one module that 
already depends on all providers; putting it next to `DefaultScmManager` would 
create a module cycle through maven-scm-test.
   
   Verified: `mvn verify` → 343 tests, 0 failures (340 before); the new unload 
test fails against a plain for-each over `ServiceLoader`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to