Background: Sometimes the company is in security considerations, need to access the Internet through proxy, this situation needs to set up HTPP agent for Maven
The setup steps are as follows:
1 First confirm that you cannot access the public central warehouse of the extranet (can be checked by pinging repo1.maven.org)
2 Ensure that the proxy server is unblocked (for example, the proxy server IP is: 218.23.234.86, you can telnet 218.23.234.86 detect that the address port is unblocked)
3 after checking the above two items, edit the ~/.m2/settings.xml file, add the following configuration
Locate the <proxies> node. Remove the corresponding comment and set the proxy information as follows:
1 <proxy> 2 <id>optional</id> 3 <active>true</active> 4 <protocol> Http</protocol> 5 <username>proxyuser</username> 6 <password>proxypass</ Password> 7
Node Element Description:
ID: The name of the agent (whatever, XYZ is OK)
Active: Indicates whether the agent is active
Protocol: Agent Agreement, this does not change
Username: User name when the agent needs authentication (if the agent does not require user authentication, username and password two nodes can be commented out)
Password: password when the agent needs authentication
Host: IP address of the proxy
Port: Port number of the agent
Nonproxyhost: Specifies a host that does not need to use a proxy, not set. If there are multiple, use | Separated
Maven Set HTTP Proxy