slachiewicz opened a new issue, #13847:
URL: https://github.com/apache/maven/issues/13847

   Proposal for master (4.x): remove `wagon-file`, `wagon-http` and 
`wagon-http-shared` (about 64 KB) from `apache-maven/pom.xml`. Everything else 
stays: the Wagon API (`wagon-provider-api`), `maven-resolver-transport-wagon`, 
`WagonConfigurator`, and Wagon providers added as build extensions. As core's 
`META-INF/maven/extension.xml` already says: "Plugins that use wagons directly 
and declare the corresponding dependency will simply use a wagon from their 
plugin realm." HttpClient 4 stays in `lib/`, since the Resolver's Apache 
transport needs it.
   
   ### What breaks without the two providers
   
   Tested with copies of Maven 3.9.16 and 4.0.0-rc-7 whose `lib/` has no 
`wagon-file*`/`wagon-http*`:
   
   | Run | Stock | Without the providers | Without, plus `wagon-http` in 
`.mvn/extensions.xml` |
   | --- | --- | --- | --- |
   | `deploy` to `file://` and `http://`, default transport | works | works | 
works |
   | `deploy` to `http://`, `-Dmaven.resolver.transport=wagon` | works, 
`WagonTransporter` | works, but the Resolver silently falls back to its own 
transport (`HttpTransporter` on 3.9, `ApacheTransporter` on 4.0) | works, 
`WagonTransporter` |
   | `site:stage` (maven-site-plugin 3.22) | works | fails: `Cannot find wagon 
which supports the requested protocol: file` | works |
   
   Normal builds are unaffected. What breaks are plugins that look up a `Wagon` 
for `file:`/`http(s):` themselves (`lookup(Wagon.class, protocol)`, an injected 
`Map<String, Wagon>`, or `maven-compat`'s `WagonManager`). These four have pull 
requests that declare the providers they need:
   
   - maven-site-plugin, `site:stage`: apache/maven-site-plugin#1354 
(`wagon-file`; `site:deploy` to plain `http:` already fails on stock Maven with 
"doesn't support directory copying")
   - versions-maven-plugin and versions-enforcer, `rulesUri`: 
mojohaus/versions#1474 (merged)
   - wagon-maven-plugin: mojohaus/wagon-maven-plugin#208
   - Felix maven-bundle-plugin, remote OBR goals: apache/felix-dev#592 
(FELIX-6876; also moves them off `WagonManager`)
   
   The same patterns appear outside these projects: eclipse-tycho's 
`tycho-version-bump-plugin` (`MavenLocationUpdater`), 
jenkinsci/incrementals-tools (`UpdateMojo`), and `WagonManager` users such as 
jenkinsci/staging-plugin, liquibase, querydsl and 
wcm-io-devops/eclipse-maven-plugin. GitHub-wide queries, to keep the list 
checkable: `"Map<String, Wagon>" language:Java`, `"lookup(Wagon.class"`, 
`"artifact.manager.WagonManager" language:Java`. NetBeans bundles its own 
wagons. IntelliJ's Maven 3 index fetcher uses `maven-compat`'s `WagonManager` 
against the Maven home's `lib/`; its Maven 4 server does not reference Wagon.
   
   ### Steps
   
   1. Release the plugin fixes above first, so released plugins work before any 
distribution drops the providers.
   2. Separately and first: warn when `maven.resolver.transport=wagon` is set 
but no Wagon provider handles the repository's protocol. Today the failed 
lookup is logged only at DEBUG, and everything only Wagon honours stops 
applying without notice: the `maven.wagon.http.*` properties (including 
`maven.wagon.http.ssl.insecure`/`allowall`, whose Resolver replacement is 
`aether.connector.https.securityMode=insecure`) and `<server><configuration>` 
children other than `httpHeaders`, `connectTimeout` and `requestTimeout`. The 
warning belongs in core, where the user's intent is known.
   3. Drop the three jars from `apache-maven/pom.xml` on master.
   4. Core ITs that force Wagon over HTTP 
(`MavenITmng7470ResolverTransportTest.testResolverTransportWagon`, 
`MavenITmng5175WagonHttpTest`) get `wagon-http` through `.mvn/extensions.xml`. 
It has to be available in the IT repository, since these ITs often run offline.
   5. Update the docs: `guide-http-settings.md`, `guide-wagon-providers.md` and 
the `maven.resolver.transport` property doc (Wagon over `http`/`file` needs an 
extension).
   
   The 3.9.x and 3.10.x lines stay as they are, because IDE integrations 
(IntelliJ's Maven 3 index fetcher) use these jars from the Maven home.
   
   ### Open questions
   
   - Should `maven.resolver.transport=wagon` without a matching provider warn 
(step 2), fail, or be documented as "extension-provided wagons only"?
   - What should `maven-compat`'s `WagonManager` resolve for `file:`/`http(s):` 
once compat itself is reconsidered for 4.x? The answer changes the scope of 
this proposal.
   


-- 
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