Creating a Maven Settings File

To use Maven you will need a settings file if any of the following are true:

How to Create Your Maven Settings File

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:

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