There are following ways to set a internet proxy in maven.
Method 1 – Command Line with mvn
$ $ mvn archetype:generate -DgroupId=com.benz.software -DartifactId=chat -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DproxySet=true -DproxyHost=53.244.194.32 -DproxyPort=3128 -DproxyUsername=<USER> -DproxyPassword=<PASSWOR | |
$ mvn clean package -DproxySet=true -DproxyHost=53.244.194.32 -DproxyPort=3128 -DproxyUsername=<USER> -DproxyPassword=<PASSWORD> | |
$ mvn [COMMAND] -Dhttp.proxyHost=[PROXY_SERVER] -Dhttp.proxyPort=[PROXY_PORT] -Dhttp.nonProxyHosts=[PROXY_BYPASS_IP] | |
$ mvn install -Dhttp.proxyHost=10.10.0.100 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.0.0.1 | |
# You can create alias for convenient uses: | |
$ alias proxy-mvn=”mvn -Dhttp.proxyHost=SERVER -Dhttp.proxyPort=PORT -Dhttp.nonProxyHosts=BYPASS_PROXY_IPS |
Method 2 – Using MAVEN_OPTS set in system env or command line
# WINDOWS
set MAVEN_OPTS="-DproxySet=true -DproxyHost= -DproxyPort=3128 -DproxyUsername= -DproxyPassword="
# LINUX
export MAVEN_OPTS="-DproxySet=true -DproxyHost= -DproxyPort=3128 -DproxyUsername= -DproxyPassword="
Method 3 – Maven proxy settings – Eclipse
To use proxy settings in eclipse while using maven, follow these steps:
- Open your Eclipse and go to Window -> Preferences.
- Click on the Browse button of User Settings, and select the settings.xml.

Mehtod 4 – In Maven Configuration $HOME/.m2/settings.xml
<settings> | |
<proxies> | |
<proxy> | |
<id>{PROXY_ID}</id> | |
<active>true</active> | |
<protocol>{PROTOCOL}</protocol> | |
<username>{USERNAME}</username> | |
<password>{PASSWORD}</password> | |
<host>{PROXY_HOST}</host> | |
<port>{PROXY_PORT}</port> | |
<nonProxyHosts>{NON_PROXY_HOSTS}</nonProxyHosts> | |
</proxy> | |
...more of <proxy> for more protocol | |
</proxies> | |
</settings> |








I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND