title: How to make maven use credentials when executing dependency plugin from command line
body: <p>I have a private Maven repository. It's defined in pom.xml of the project</p>
  
  <pre><code>    &lt;repository&gt;
          &lt;id&gt;some.id&lt;/id&gt;
          &lt;url&gt;https://some.host/artifactory/some.id&lt;/url&gt;
      &lt;/repository&gt;
  </code></pre>
  
  <p>In my <code>~/.m2/settings.xml</code>, I have proper authentication block:</p>
  
  <pre><code>    &lt;server&gt;
          &lt;id&gt;some.id&lt;/id&gt;
          &lt;username&gt;pawel.veselov@domain.com&lt;/username&gt;
          &lt;password&gt;{some-fancy-password-hash-goes-here}&lt;/password&gt;
      &lt;/server&gt;
  </code></pre>
  
  <p>When building the project, Maven is able to access the repository without any problems, as it's supposed to be. In debugging output, I can see it applying the credentials.</p>
  
  <p>But when I try to download an artifact directly, it doesn't look like Maven is even considering the settings file.</p>
  
  <pre><code>mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:get \
    -DremoteRepositories=some.id::::https://some.host/artifactory/some.id \
    -Dartifact=groupId:artifactId:1.1.1
  </code></pre>
  
  <p>The username is not transmitted. I can see in the debug output, that the <code>BasicRepositoryConnector</code> is invoked without username/password combination.</p>
  
  <p>So the question goes - can a plugin be invoked so that whatever process makes Maven consider using the authentication stated in its settings file is executed?</p>