Michael Osipov <micha...@apache.org> 于2020年5月31日周日 下午3:56写道:

>
> Am 2020-05-31 um 03:31 schrieb Hongyi Zhao:
> > Hi,
> >
> > I'm using Ubuntu 20.04 and installed maven using ` sudo apt-get
> > install maven `.

I've installed the latest version from maven official website and set
the PATH to override the system's maven,
so this should be no need for my case. See the following for more info.

> Now, I want to set socks5 proxy for maven.
>
> We don't support Debian-packaged Maven versions for various reasons.

Sorry for above descriptions, in fact, I use the pre-compiled package
supplied by maven official website here:

https://apachemirror.sg.wuchna.com/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

See the following for more information:

$ which mvn
/opt/apache-maven/3.6.3/bin/mvn


>
> > When I set
> > it via environment variable liek this:
> >
> > export MAVEN_OPTS="-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=18887"
> >
> > It can work smoothly.
>
> Define works! what exactly works?

It seems I'm wrong. Even with the above enviroment variable, I still
see the following info:

$ mvn -X clean install | grep 'Using connector BasicRepositoryConnector'
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for
https://repo.maven.apache.org/maven2
^C

Obviously, there are no proxy activated for the connection.

In the previously postings, due that there are so many packages have
already been downloaded into the local repository here:
~/.m2/repository/, which makes the maven compile procedure so fast and
doesn't need to download them from the remote repository. As a result,
I simply think that it's the socks5 proxy that speed up the remote
packages downloading progress.


>
> > But if I set it by using ` ~/.m2/setting.xml ', the socks5 proxy
> > cannot be used at all.  The content of the setting.xml file is as
> > following:
> >
> > <proxies>
> > <proxy>
> >        <id>ss</id>
> >        <active>true</active>
> >        <protocol>socks5</protocol>
> >        <username></username>
> >        <password></password>
> >        <host>127.0.0.1</host>
> >        <port>18887</port>
> >        <nonProxyHosts>127.0.0.1</nonProxyHosts>
> >   </proxy>
> > </proxies>
>
> If you want to use HTTP transport (Resolver/Wagon) via Socks 5 proxy, it
> will not work because Apche HttpClient does not support Socks5 proxies
> with our setup.

Got it, thanks for your clarification.

Regards,
HY

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>


--
Hongyi Zhao <hongyi.z...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to