Skip to content

Publish the HTTP and WebDAV wagons as JSR-330 beans - #987

Merged
slachiewicz merged 1 commit into
agent/wagon-sisu-provided-scopefrom
agent/wagon-jsr330-http-dav
Sep 4, 2026
Merged

Publish the HTTP and WebDAV wagons as JSR-330 beans#987
slachiewicz merged 1 commit into
agent/wagon-sisu-provided-scopefrom
agent/wagon-jsr330-http-dav

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 4, 2026

Copy link
Copy Markdown
Member

Closes #988. Stacked on #986.

wagon-http and wagon-webdav-jackrabbit were the two providers 20d688a left on handwritten Plexus descriptors, because each maps one implementation onto several role hints and a single @Named cannot express that. This gives each hint its own empty subclass, the way wagon-ftp and wagon-http-lightweight already publish theirs, and removes both META-INF/plexus/components.xml files.

Hint Before After
http HttpWagon HttpWagon
https HttpWagon HttpsWagon extends HttpWagon
dav WebDavWagon WebDavWagon
davs WebDavWagon WebDavsWagon extends WebDavWagon
dav+http WebDavWagon WebDavHttpWagon extends WebDavWagon
dav+https WebDavWagon WebDavHttpsWagon extends WebDavWagon

Every hint keeps returning an instance that is still a HttpWagon or a WebDavWagon, so an instanceof check on either resolves as it does today. All six components declared instantiation-strategy="per-lookup", which is the JSR-330 default, so none needs @Singleton.

The cost is five new public classes. They are empty and exist only to carry a component name, but they become API on release. The alternative is to keep both descriptors and accept that these two providers need the Plexus shim while the other eight do not.

master carries the same two descriptors.

Verified: after mvn clean install, the generated META-INF/sisu/javax.inject.Named in both jars and in the wagon-http shaded jar lists exactly the six implementations above, and no components.xml remains in either; BUILD SUCCESS, 986 tests, 0 failures.

This change was created with AI assistance.

These two providers kept handwritten Plexus descriptors because each maps one
implementation onto several role hints, which a single @nAmed cannot express. Give
each hint its own empty subclass, the way wagon-ftp and wagon-http-lightweight
already do, so all ten providers now resolve from the Sisu index alone.

Do not restore the descriptors to add a hint: a component named there is invisible
to any consumer that scans for @nAmed beans without the Plexus shim.
@slachiewicz
slachiewicz marked this pull request as ready for review September 4, 2026 11:05
@slachiewicz
slachiewicz merged commit cb1c13c into agent/wagon-sisu-provided-scope Sep 4, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the agent/wagon-jsr330-http-dav branch September 4, 2026 11:11
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

@slachiewicz The PR can't be associated to a milestone, because there are multiple open milestones. Please add the text "branch: agent/wagon-sisu-provided-scope" to the description to the milestone where this PR belongs to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant