How to configure a proxy in Maven settings?
When we work behind a proxy server, we need to configure Maven to be able to connect to the internet. To enable proxy we can configure Maven settings.xml file, either in ${M2_HOME}/conf/settings.xml or ${user.home}/.m2/settings.xml file. <?xml version="1.0" encoding="UTF-8"?> <settings> . . <proxies> <proxy> <id>my-proxy</id> <active>true</active> <protocol>http</protocol> <host>proxy.example.org</host> <port>8080</port> <username>username</username> <password>password</passw...
Article by Wayan · Source: Kode Java ↗
When we work behind a proxy server, we need to configure Maven to be able to connect to the internet. To enable proxy we can configure Maven settings.xml file, either in ${M2_HOME}/conf/settings.xml or ${user.home}/.m2/settings.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<settings>
.
.
<proxies>
<proxy>
<id>my-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.org</host>
<port>8080</port>
<username>username</username>
<password>password</password>
<nonProxyHosts>*.example.org|*.example.com</nonProxyHosts>
</proxy>
</proxies>
.
.
</settings>
The <proxy> element in the configuration above contains the information about the proxy server. These include information about the host, port, username and password. Set these elements to match your proxy server configuration.
Comments 0
Share your questions, experiences, or feedback about this article.
Sign in with Google to leave a comment.
Sign in with Google
No comments yet. Be the first to share your feedback.