Upgrade from Commons HttpClient 3.x to HttpComponents Client 4.x #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
jdk-tool
, which is bundled in core, uses a patched version of the deprecated Commons HttpClient 3.x library. Using deprecated code is not sustainable and inhibits us from eventually removing this library from core in jenkinsci/jenkins#7312.Solution
While in the long term this plugin ought to be rewritten to comply with JDK Script Friendly URLs and/or the native HTTP client in newer versions of the Java Platform, both of those are more involved changes. In the short term the most expedient solution that allows this plugin to still be bundled with Jenkins core (but without using a deprecated library) is to upgrade from Commons HttpClient 3.x to HttpComponents Client 4.x.
Testing done
With
I exercised all the changed lines (including proxy authentication) in a Pipeline job in the debugger except for the
if (m.getURI().getHost().equals("login.oracle.com"))
code path (lines 516-579) which I could not test because I do not have an Oracle support contract. I doubt that code path still works anyway. If it actually was working before and happens to regress, and if some user with an Oracle support contract actually cares about this, I would encourage them to debug it using their Oracle account and submit a pull request.CC @jglick