Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://maven.apache.org/settings.html#Quick_Overview" rel="nofollow">Default locations</a> of your settings files are:</p> <blockquote> <p>There are two locations where a settings.xml file may live:</p> <ul> <li>The Maven install: $M2_HOME/conf/settings.xml </li> <li>A user's install: ${user.home}/.m2/settings.xml</li> </ul> </blockquote> <p><code>M2_HOME</code> is path to maven installation directory. The defaults can be found in the <a href="http://maven.apache.org/download.cgi" rel="nofollow">maven installation instructions</a>:</p> <ul> <li>win xp/2k: <code>C:\Program Files\Apache Software Foundation\apache-maven-3.1.0</code></li> <li>unix based: <code>/usr/local/apache-maven/apache-maven-3.1.0</code></li> </ul> <p>or open command prompt/terminal and type:</p> <ul> <li>win xp/2k: <code>echo %M2_HOME%</code></li> <li>unix based: <code>echo $M2_HOME</code></li> </ul> <p>To change the location of your central repository its <a href="http://maven.apache.org/guides/mini/guide-mirror-settings.html" rel="nofollow">mirror can be defined</a>. Open your <code>settings.xml</code> and add:</p> <pre><code>&lt;settings&gt; ... &lt;mirrors&gt; &lt;mirror&gt; &lt;id&gt;myMirrorId&lt;/id&gt; &lt;name&gt;mirror of a central repo&lt;/name&gt; &lt;url&gt;http://server&lt;/url&gt; &lt;mirrorOf&gt;central&lt;/mirrorOf&gt; &lt;/mirror&gt; &lt;/mirrors&gt; ... &lt;/settings&gt; </code></pre> <p>Now when running maven from your project root folder with the debug output (<code>-X</code>) you should see in the beggining of your console output:</p> <pre><code>[DEBUG] Using mirror myMirrorId (http://server) for central (http://repo.maven.apache.org/maven2). </code></pre> <p>The default central repo has <code>id</code> central and that's why that is the value of <code>mirrorOf</code> tag. My default central repo is the one you are trying to set.</p> <blockquote> <p>I also wonder why different computers from same network got different repo to download.</p> </blockquote> <p>If you comment everything in your user settings file (leave just the outer <code>settings</code> tags) and have default global settings file (which is basically empty) running:</p> <pre><code>mvn help:effective-settings </code></pre> <p>will dump practically empty settings. When building project maven still knows the location of the central repo, because every pom file inherits from the <a href="http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html" rel="nofollow">super pom</a> and that is where the default central repo URL is defined:</p> <pre><code>&lt;repositories&gt; &lt;repository&gt; &lt;id&gt;central&lt;/id&gt; &lt;name&gt;Central Repository&lt;/name&gt; &lt;url&gt;http://repo.maven.apache.org/maven2&lt;/url&gt; &lt;layout&gt;default&lt;/layout&gt; &lt;snapshots&gt; &lt;enabled&gt;false&lt;/enabled&gt; &lt;/snapshots&gt; &lt;/repository&gt; &lt;/repositories&gt; </code></pre> <p>The super pom is located at <code>$M2_HOME/lib/maven-model-builder-&lt;VERSION&gt;.jar</code> under <code>/org/apache/maven/model/pom-4.0.0.xml</code>.</p> <p>As Robert Scholte informed, as of 3.0.4 the default URL has been changed from <code><a href="http://repo1.maven.org/maven2" rel="nofollow">http://repo1.maven.org/maven2</a></code> to <code><a href="http://repo.maven.apache.org/maven2" rel="nofollow">http://repo.maven.apache.org/maven2</a></code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload