slachiewicz opened a new pull request, #1001: URL: https://github.com/apache/maven-wagon/pull/1001
A wagon keeps its connection, session and transfer listeners, so a lookup must never hand out a shared instance. Up to 3.5.3 every wagon was declared `instantiation-strategy="per-lookup"` in its Plexus metadata. Since #926 moved the providers to JSR-330, the same behaviour comes from Sisu's default (unscoped) scope, so it holds only as long as nobody annotates a wagon `@Singleton`. Nothing tested that. - `WagonTestCase.testWagonLookupReturnsNewInstance` looks up the provider's protocol twice and asserts two different instances. Every provider test that extends `WagonTestCase` inherits it. - `FtpWagonLookupTest` and `WebDavWagonLookupTest` cover the hints that no `WagonTestCase` subclass uses: `ftps`, `ftph`, `dav+http` and `dav+https`. Each checks that the hint finds the right wagon class and returns a new instance on every lookup. (`FtpsWagonTest` is a plain unit test of the protection-level handling and never looks the wagon up.) With this, every wagon hint is covered: file, ftp, ftps, ftph, http, https (httpclient and lightweight), scm, scp, sftp, scpexe, dav, davs, dav+http, dav+https. Verified on master: - all 23 `WagonTestCase` subclasses and both new lookup tests pass - annotating `FileWagon` or `FtpsWagon` with `@Singleton` makes them fail with `expected: not same but was: …` While checking #926 I also compared every former `@plexus.component` with its JSR-330 form. The two implicit Plexus singletons (`LightweightHttpWagonAuthenticator`, `PrompterUIKeyboardInteractive`) are `@Singleton`, everything that was `per-lookup` is unscoped, and the `@plexus.configuration` default values were already Java field initializers. Nothing else needs to change. Same change for `wagon-3.x`: #1000. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
