If HTTP_PROXY or HTTPS_PROXY is set in the environment but MAVEN_OPTS is not set in the environment we should set MAVEN_OPTS with the detected proxy configuration.
We could also read ~/.m2/settings.xml and detect proxy configuration before setting MAVEN_OPTS.
If proxy is set in the environment and a ~/.m2/settings.xml file exist or MAVEN_OPTS is set and neither is configured with proxy, we should emit a warning and perhaps modify MAVEN_OPTS to add proxy.
There should also be a hidden option to disable this behavior in case the current environment is intended by the user.