[ 
https://issues.apache.org/jira/browse/MNG-7721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17696943#comment-17696943
 ] 

Nejc Habjan commented on MNG-7721:
----------------------------------

This is standard behavior for most Java tooling AFAIK, see also 
[https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html.] We'd 
prefer having one common way of configuring this. I may be wrong but I see this 
way of doing it more in CI.

Proxy is very host-specific and often configured in CI workflows, where it can 
differ between distributed ephemeral builds (some runners may or may not 
require it). Also just for consistency with older versions as well as with 
Gradle, which works exactly the same way with `GRADLE_OPTS`, so we can give 
users consistent instructions on proxy usage.

Also outside of the java world, most other tools support standard proxy 
environment variables (http_proxy, https_proxy, no_proxy), which is usually 
best practice for configuring it dynamically e.g. in CI. Configuring this via 
MAVEN_OPTS and GRADLE_OPTS is the closest we get to that standard behavior.

> Maven 3.9 resolver ignores proxy configured via MAVEN_OPTS
> ----------------------------------------------------------
>
>                 Key: MNG-7721
>                 URL: https://issues.apache.org/jira/browse/MNG-7721
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap & Build
>    Affects Versions: 3.9.0
>            Reporter: Nejc Habjan
>            Priority: Major
>
> The new native resolver seems to no longer respect HTTP/S proxy configuration 
> set as options via `MAVEN_OPTS`. I haven't tried if this also happens when 
> supplying the options directly via CLI as well, I assume that might be the 
> case?
> Sample GitLab CI script that worked with 3.8.7 but now fails with 3.9:
> {code:java}
> image: maven:3.9
> build:
>   variables:
>     MAVEN_OPTS: >-
>       -Dhttp.proxyHost=$PROXY_HOST
>       -Dhttp.proxyPort=$PROXY_PORT 
>       -Dhttps.proxyHost=$PROXY_HOST
>       -Dhttps.proxyPort=$PROXY_PORT
>       -Dhttp.nonProxyHosts=$NO_PROXY_HOSTS
>   script:
>     - mvn clean install{code}
> Likely introduced in [https://github.com/apache/maven/pull/892].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to