To use Maven you will need a settings file if any of the following are true:
You have installed Maven for the first time .
You are working behind a firewall or proxy server.
Your organization has its own internal Maven Repository Manager.
To create a Maven settings file, create a XML file called settings.xml. If your user name is Bob, then the directory path for the settings.xml file should be the following:
/home/bob/.m2/settings.xml.
For Windows, If your user name is Bob then the directory path for the settings.xml file should be the following:
/users/bob/.m2/settings.xml.
You are going to add to your settings file the following information:
Proxy - sets the HTTP proxy server that is required to access Maven repositories on the Internet.
Servers - sets the credentials for the Maven repository, so that you do not have to enter them every time you want to access the repository.
Mirrors - directs that instead of trying to access the Maven central repository directly, it should use your internal Maven repository manager as a mirror (cache) of Maven central repository.
Add these settings as shown in Example: Maven Settings File.
Maven Settings File
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.mycompany.com</host>
<port>8080</port>
<nonProxyHosts>mycompany.com</nonProxyHosts>
</proxy>
</proxies>
<servers>
<server>
<id>maven.mycompany.com</id>
<username>me@mycompany.com</username>
<password>{COQLCE6DU6GtcS5P=}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>archiva</id>
<name>Internal Archiva Mirror of Central</name>
<url>http://archiva.mycompany.com/repositories/internal</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
For more information about available Maven settings, see the Apache Maven documentation at, http://maven.apache.org/settings.html