Maven Through an HTTP Proxy

If you're using Maven through an HTTP proxy, you might have banged your head why on earth the snippet below in ~/.m2/settings.xml isn't enough to get all Maven plugins to work perfectly with the proxy (no, it's not because of protocol=http):


For most Maven plugins, this works great. However, for a few, it doesn't and mvn just hangs forever.

It turns out, for some underlying Maven components (possibly related to this bug in Maven), it's not enough and you'll have to set the same values in the MAVEN_OPTS environment variable:

export MAVEN_OPTS="

That took me a while to figure out, have been doing all sorts of somersaults over and under this πŸ€Έβ€β™‚οΈ

Licensed under CC BY Creative Commons License ~ βœ‰ torstein.k.johansen @ gmail ~ 🐘 ~ 🐦 @torsteinkrause