title: how to get maven archetypes from my own authenticated nexus without username and password in the URL?
body: <p>I have a private Nexus with a repository protected via authentication.</p>
  
  <p>Pulling libraries works like a charm, but if I want to use one of the archetypes stored up there I always need to write plaintext username and password in the URL of the archetype catalog like this:</p>
  
  <pre><code>mvn archetype:generate -DarchetypeCatalog=http://username:password@maven.mycompany.com/nexus/content/repositories/myrepo/archetype-catalog.xml
  </code></pre>
  
  <p>I read <a href="http://maven.apache.org/archetype/maven-archetype-plugin/faq.html#authentication" rel="noreferrer">http://maven.apache.org/archetype/maven-archetype-plugin/faq.html#authentication</a> and updated my settings.xml with what I understood from that very tiny bit of help:</p>
  
  <pre><code>&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                        http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
  
    &lt;servers&gt;
      &lt;server&gt;
        &lt;id&gt;myrepo&lt;/id&gt;
        &lt;username&gt;username&lt;/username&gt;
        &lt;password&gt;{HASHED_PASSWORD}&lt;/password&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;id&gt;pretty-archetype-unicorn-repo&lt;/id&gt;
        &lt;username&gt;username&lt;/username&gt;
        &lt;password&gt;{HASHED_PASSWORD}&lt;/password&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
  
    &lt;profiles&gt;
     &lt;profile&gt;
       &lt;id&gt;someid&lt;/id&gt;
       &lt;repositories&gt;
         &lt;repository&gt;
           &lt;id&gt;myrepo&lt;/id&gt;
           &lt;name&gt;My Repo&lt;/name&gt;
           &lt;url&gt;http://maven.mycompany.com/nexus/content/repositories/myrepo/&lt;/url&gt;
         &lt;/repository&gt;
       &lt;/repositories&gt;
     &lt;/profile&gt;
    &lt;/profiles&gt;
  
    &lt;activeProfiles&gt;
      &lt;activeProfile&gt;someid&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;
  
  &lt;/settings&gt;
  </code></pre>
  
  <p>Needless to say, it doesn't work and when I try:</p>
  
  <pre><code>mvn archetype:generate -DarchetypeCatalog=http://maven.mycompany.com/nexus/content/repositories/myrepo/archetype-catalog.xml
  </code></pre>
  
  <p>I get the same old:</p>
  
  <pre><code>[WARNING] Error reading archetype catalog http://maven.mycompany.com/nexus/content/repositories/myrepo/archetype-catalog.xml
  org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://maven.mycompany.com/nexus/content/repositories/myrepo/archetype-catalog.xml
  </code></pre>
  
  <p>Any hints, or better documentation with working example?</p>