Re: Standard http proxy environment variable evaluation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Standard http proxy environment variable evaluation

michaelo
Am 2019-10-10 um 12:08 schrieb Cédric Blomart (FOD Economie - SPF Economie):

> Hello,
>
> By looking at this over the internet I don't find much informations.
> Apparently the sole reliable way to configure proxy usage is trough ".m2/settings.xml" which annoys me when using CI/CD and docker behind proxies.
>
> We do set standard environment variables for proxies in the builds that needs it. But maven doesn't use these variables.
>
> I would like to lookup if it would be possible to evaluate http_proxy or https_proxy environment variables to fill in proxy settings.
>
>
> I didn't find any opened Jira about that altought there are a lot ramblings about using java properties ("-Dhttp.proxyHost" ...).
>
> Any remarks, toughts about this?

The reason why this is not done is because Java is not C, thus not using
environment variables.

There are several ways to solve this:

* Introduce a custom route planner which will read the vars. HttpClient
does not have a proxy selector abstraction
* Set the JVMs default proxy selector to your custom implemenation and
HttpClient will pick it up automatically.

All of this is Maven Wagon related

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]