[wagon-3.x] Add user, developer and HTTP configuration guides - #905
Conversation
…configuration guides
…vadoc The TCK recovers a use-case id by walking the stack and comparing against the runtime class's package, so subclassing a TCK test class from another package silently skips every case. Say so in the development guide. The BasicAuthScope javadoc named three configuration elements that do not exist (/server/proxyBasicAuth, /server/basicAuthentication/realm) or are not used by the method (/repository/password). Describe the actual members and the actual behaviour, including that realm does not honour "ANY" the way host and port do. No behaviour change.
|
Second commit added, and it turned up a code defect worth knowing about before review. Writing the corrected That also means this PR's first commit had it wrong: Also in this commit: a developer-guide subsection on running the TCK classes rather than subclassing them from your own package. The use-case id is recovered by walking the stack for the last method before the first frame outside Site still builds; the new heading and the corrected text were checked in the rendered HTML. |
There was a problem hiding this comment.
Pull request overview
Adds long-requested Maven Wagon documentation guides to the project site, covering end-user usage, provider development/testing, and wagon-http configuration, plus a small Javadoc clarification to align source docs with the new HTTP guide content.
Changes:
- Add three new site pages: User Guide, Development & Testing Guide, and HTTP Configuration guide.
- Expose the new guides in the Maven Site navigation (
src/site/site.xml). - Clarify
BasicAuthScope#getScope(...)Javadoc to describe its override semantics and the special handling of"ANY"and realm matching.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/BasicAuthScope.java | Updates Javadoc to accurately describe AuthScope override/ANY behavior referenced by the new HTTP configuration guide. |
| src/site/site.xml | Adds a “Guides” menu linking the new pages into the generated site navigation. |
| src/site/markdown/user-guide.md | Introduces an end-user guide covering Wagon lifecycle, providers, auth, proxies, timeouts, streaming, listeners, and error mapping. |
| src/site/markdown/developer-guide.md | Introduces a provider-focused guide for SPI, registration mechanisms, provider-test usage, HTTP TCK wiring, and running tests/site. |
| src/site/markdown/http-configuration.md | Documents wagon-http <server><configuration> options and how they map to HttpClient 4.5 behavior, including merge semantics and params keys. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Forward-port of #905 and 20c10e6, which landed on wagon-3.x. master had no prose documentation at all beyond the index page. The guides are rewritten where 3.x and master have since diverged, so they describe this branch rather than that one: * Providers are registered with JSR-330 @nAmed and indexed by sisu-maven-plugin, not with @plexus.component javadoc tags processed by plexus-component-metadata. The section now covers @typed, which 3.x needs no equivalent of, and says why a Wagon must not be @singleton. * Configurable properties are plain fields with setters and an initialiser for the default; there is no @plexus.configuration tag any more. * The TCK takes <useCaseConfigsResource> pointing at a classpath resource rather than an inline <useCaseConfigs> tree. * The note about the long-form header syntax being needed by plexus-container-default is dropped, since the tests no longer run on it. * The extension example uses 4.0.0-M1. The embedding section needed more than a touch-up. It told callers to build a bare DefaultPlexusContainer and said descriptors are picked up automatically, which stopped being true here: with classpath scanning off, such a container reads only components.xml and so finds wagon-http and wagon-webdav-jackrabbit, which keep hand-written descriptors for their several hints, and no other provider. It now shows SCANNING_INDEX and names the partial failure, since a lookup that silently stops resolving is easy to misread.
Three guides that have been requested for a long time.
Closes #191 (WAGON-1, open since 2004). Closes #190 (WAGON-3, open since 2004). Closes #490 (WAGON-425, open since 2014).
user-guide.mdRepositoryURL parsing including credentials being stripped fromgetUrl();AuthenticationInfo; proxies andnonProxyHostsglobbing; the two timeouts; streaming versus file transfer; listeners, including thattransferProgressruns synchronously on the transfer thread; the exception table with the actual message wordingdeveloper-guide.mdAbstractWagonprovides and the two methods a provider must supply;StreamWagon's contract and when it does not fit; both registration mechanisms — the@plexus.componenttag and a hand-writtencomponents.xml;wagon-provider-testand what you inherit fromWagonTestCase; the HTTP TCK, its use-case ids, and how to wire it in and mark a case unsupported; running the suiteshttp-configuration.md<server><configuration>block for wagon-http;httpConfigurationand the sixHttpMethodConfigurationproperties; the merge semantics and their consequences; both XML spellings Plexus accepts; all 17 recognisedparamskeys mapped to theirRequestConfigsetters; auth schemes, preemptive auth, scope overrides, proxy and NTLM; the deprecatedhttpHeaders; 429 backoff; the system-property referenceEverything is grounded in the source. Where something could not be verified from this repository it was left out rather than guessed — noted below.
mvn sitebuilds. The rendered HTML was checked rather than just the exit code, which caught one real defect: Doxia generates heading ids asWhat_a_Wagon_is, not the kebab-case GitHub form, so the cross-page anchors were dead until corrected.Deliberately not covered
How
settings.xmlpopulatesProxyInfo.ntlmHost/ntlmDomain(that mapping lives in Maven core), how Resolver's wagon transport picks a provider (out of this repository), and which of wagon-http or wagon-http-lightweight wins when both are on the class path (the container decides, not Wagon).Things found in the code while writing this
Documented where they affect the reader, not fixed here, and worth separate issues:
usePreemptivenever survives a merge.HttpMethodConfiguration.copy()does not copy it andConfigurationUtils.merge()never applies it, so whenever both<all>and the block for a method are present the effective value is alwaysfalse.HttpWagonPreemptiveTestpasses only because it sets<all>alone.NTCredentialsis only ever constructed for a proxy, so the registered NTLM scheme has nothing usable to offer an NTLM-protected repository. This is the most likely way a reader of WAGON-425 would be misled.// FIXME Perform only when preemptive has been configured.Wagon.DEFAULT_*.BasicAuthScope's javadoc documents/server/proxyBasicAuth, which matches no field; the field isproxyAuth.README.mdtells contributors to runmvn -Prun-its verify. There is norun-itsprofile anywhere in this repository.wagon-tcks/wagon-tck-http/sample-tck-consumeris in no<modules>, still 1.0-SNAPSHOT against decade-old dependencies, and is the only thing resembling "how to consume the TCK". The guide documents the real wiring fromwagon-http'sTckTestinstead.The four provider pages carrying the "removed in version 4.0.0" notice were left alone. The new pages describe what exists and do not repeat that claim.