slachiewicz opened a new pull request, #912: URL: https://github.com/apache/maven-wagon/pull/912
> Stacked on #911 -- the diff shown here includes that PR's four commits until it > merges. Only the last commit belongs to this one. The `@plexus.component` / `@plexus.requirement` / `@plexus.configuration` javadoc tags predate even the Plexus annotations, and needed `plexus-component-metadata` to turn them into descriptors at build time. This replaces them with `@Named` and `@Inject`, and lets `sisu-maven-plugin` index the beans instead. 20 components, 7 injection points, 10 configuration tags. Verified in the built jars: the annotated providers now ship only `META-INF/sisu/javax.inject.Named` and no generated `components.xml`. ### The parts that are not mechanical **Scope.** Plexus defaults to singleton, JSR-330 to per-lookup. Eighteen components declared `instantiation-strategy="per-lookup"`, but `LightweightHttpWagonAuthenticator` and `PrompterUIKeyboardInteractive` did not, so they are `@Singleton` to keep today's scope. That matters for the authenticator: it registers itself via `Authenticator.setDefault` and keys wagons by `ThreadLocal`, so one instance per wagon would let concurrent wagons overwrite the JVM-wide authenticator and resolve another thread's credentials as null. **Roles.** Sisu publishes a bean under every interface it implements; Plexus published it under the single declared role. `AbstractJschWagon` implements `SshWagon` *and* `CommandExecutor`, and `ScpExternalWagon` implements `CommandExecutor`, so `ScpWagon`, `SftpWagon` and `ScpExternalWagon` would all gain `CommandExecutor` bindings they do not have today. Worse, `ScpCommandExecutor` extends `ScpWagon` and `ScpExternalCommandExecutor` extends `ScpExternalWagon`, so each executor would collide with its parent on the same hint and `lookup` would become nondeterministic. `@Typed` pins all five back to their Plexus role. **Configuration defaults** are dropped rather than translated. Six restate a value the field already initialises; the other four never set a default at all (one even uses `default=` instead of `default-value=`). Per-server configuration still arrives through the resolver's wagon configurator, which works on the instance. **Multi-hint components.** `wagon-http` maps `HttpWagon` to `http` and `https`, and `wagon-webdav-jackrabbit` maps `WebDavWagon` to `dav`, `davs`, `dav+http` and `dav+https`. A single `@Named` cannot express that, so both keep their handwritten descriptors, which the shim reads regardless of scanning. Their now-redundant tag and generator binding are removed. The test containers are switched to `SCANNING_INDEX`, since the beans they look up are no longer in a descriptor. ### Downstream Maven is unaffected: `PlexusWagonProvider` does `lookup(Wagon.class, hint)` and Maven configures its container with index scanning. A third-party embedder building a default `DefaultPlexusContainer` (scanning off) would read only `components.xml` and silently stop finding the annotated wagons -- `http` and `dav` would still resolve, the rest would not. That is worth an explicit release note for 4.0.0-M1. Full reactor green, all 17 modules. Draft until #911 lands. Not for `wagon-3.x`. -- 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]
