title: Configure Maven settings for deployment
body: <p>I want to deploy artifacts to Nexus from Jenkins to different repositories (like <code>builds-all</code>, <code>builds-verified</code>, <code>releases</code>). The thing is that I want to keep minimal configuration in the project POM file. My settings file now looks like:</p>
  
  <pre><code>&lt;servers&gt;
      &lt;server&gt;
          &lt;id&gt;orion-nexus&lt;/id&gt;
          &lt;username&gt;admin&lt;/username&gt;
          &lt;password&gt;password&lt;/password&gt;
      &lt;/server&gt;
  &lt;/servers&gt;
  
  &lt;localRepository&gt;~/.m2/repository&lt;/localRepository&gt;
  
  &lt;profiles&gt;
      &lt;!-- Deployment configuration for CI builds for mainline --&gt;
      &lt;profile&gt;
          &lt;id&gt;build&lt;/id&gt;
          &lt;repositories&gt;
              &lt;repository&gt;
                  &lt;id&gt;builds-all&lt;/id&gt;
                  &lt;url&gt;http://orion-nexus:8081/&lt;/url&gt;
                  &lt;snapshots&gt;
                      &lt;checksumPolicy&gt;fail&lt;/checksumPolicy&gt;
                  &lt;/snapshots&gt;
              &lt;/repository&gt;
          &lt;/repositories&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p></p>
  
  <p>Project POM:</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;orion-nexus&lt;/id&gt;
          &lt;layout&gt;default&lt;/layout&gt;
          &lt;url&gt;&lt;!-- how to avoid explicit URL? --&gt;&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>I wan to run deploy like <code>mvn -B -P build clean install deploy</code>. However, I don't understand how to avoid setting explicit URL in distribution management section. Can I set a variable in settings file and propagate it to my POM? </p>
  
  <p>Is there any step-by-step guide for such workflow?</p>