There are following ways to set a internet proxy in maven.
Method 1 – Command Line with mvn
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="
Code language: PHP (php)
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
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals