title: Why is Maven uploading incorrectly snapshots to release repository?
body: <p>I'm trying to use the maven-deploy-plugin to upload releases and snapshots into a Nexus repository. However I run across this error</p>
  
  <pre><code>[INFO] [deploy:deploy {execution: default-deploy}]
  [INFO] Retrieving previous build number from nexus
  Uploading: http://localhost:8081/nexus/content/repositories/snapshots/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120605.140242-20.jar
  56K uploaded  (edr-app-1.0.4-20120605.140242-20.jar)
  [INFO] Uploading project information for edr-app 1.0.4-20120605.140242-20
  [INFO] Retrieving previous metadata from nexus
  [INFO] Uploading repository metadata for: 'artifact info.afilias.edr:edr-app'
  [INFO] Retrieving previous metadata from nexus
  [INFO] Uploading repository metadata for: 'snapshot info.afilias.edr:edr-app:1.0.4-SNAPSHOT'
  [INFO] Retrieving previous build number from nexus
  Uploading: http://localhost:8081/nexus/content/repositories/snapshots/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120605.140242-20.tar.gz
  4286K uploaded  (edr-app-1.0.4-20120605.140242-20.tar.gz)
  [INFO] [deploy:deploy-file {execution: default}]
  Uploading: http://localhost:8081/nexus/content/repositories/releases/info/afilias/edr/edr-app/1.0.4/edr-app-1.0.4.tar.gz
  89530K uploaded  (edr-app-1.0.4.tar.gz)
  [INFO] Uploading project information for edr-app 1.0.4
  [INFO] Retrieving previous metadata from remote-repository
  [INFO] Uploading repository metadata for: 'artifact info.afilias.edr:edr-app'
  [INFO] Retrieving previous build number from remote-repository
  [INFO] repository metadata for: 'snapshot info.afilias.edr:edr-app:1.0.4-SNAPSHOT' could not be found on repository: remote-repository, so will be created
  Uploading: http://localhost:8081/nexus/content/repositories/releases/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120605.140242-20.tar.gz
  [INFO] ------------------------------------------------------------------------
  [ERROR] BUILD ERROR
  [INFO] ------------------------------------------------------------------------
  [INFO] Error deploying attached artifact /home/mren/trunk2/target/edr-app-1.0.4-SNAPSHOT.tar.gz: Error deploying artifact: Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120605.140242-20.tar.gz. Return code is: 400
  </code></pre>
  
  <p>Here's my configuration in the pom.xml:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
   ...
      &lt;distributionManagement&gt;
         &lt;repository&gt;
            &lt;id&gt;releases&lt;/id&gt;
            &lt;name&gt;Releases&lt;/name&gt;
            &lt;url&gt;http://localhost:8081/nexus/content/repositories/releases&lt;/url&gt;
          &lt;/repository&gt;
          &lt;snapshotRepository&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;Snapshots&lt;/name&gt;
            &lt;url&gt;http://localhost:8081/nexus/content/repositories/snapshots&lt;/url&gt;
          &lt;/snapshotRepository&gt;
        &lt;/distributionManagement&gt;
    ...
    &lt;build&gt;
     ...
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.7&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;deploy&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;deploy-file&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;file&gt;target/edr-install-1.0.4-${revision}.tar.gz&lt;/file&gt;
                &lt;url&gt;${project.distributionManagement.repository.url}&lt;/url&gt;
                &lt;packaging&gt;tar.gz&lt;/packaging&gt;
                &lt;artifactId&gt;artifactId&lt;/artifactId&gt;
                &lt;groupId&gt;groupId&lt;/groupId&gt;
                &lt;version&gt;1.0.4-${revision}&lt;/version&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
     ...
    &lt;/build&gt;
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>And from my settings.xml file:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;settings&gt;
    &lt;server&gt;
        &lt;id&gt;releases&lt;/id&gt;
        &lt;username&gt;admin&lt;/username&gt;
        &lt;password&gt;admin123&lt;/password&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
        &lt;username&gt;admin&lt;/username&gt;
        &lt;password&gt;admin123&lt;/password&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;nexus&lt;/id&gt;
        &lt;activation&gt;
          &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
        &lt;/activation&gt;
        &lt;repositories&gt;
          &lt;repository&gt;
            &lt;id&gt;releases&lt;/id&gt;
            &lt;name&gt;Releases&lt;/name&gt;
            &lt;url&gt;http://localhost:8081/nexus/content/repositories/releases&lt;/url&gt;
            &lt;releases&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
            &lt;/releases&gt;
            &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
            &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;Snapshots&lt;/name&gt;
            &lt;url&gt;http://localhost:8081/nexus/content/repositories/snapshots&lt;/url&gt;
            &lt;releases&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
            &lt;/releases&gt;
            &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
            &lt;/snapshots&gt;
          &lt;/repository&gt;
        &lt;/repositories&gt;
        &lt;/profile&gt;
    &lt;/profiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>I'm sure this configuration worked at one point, but now it's spitting out an error. Not sure what is wrong.</p>
  
  <p>And the nexus log tells me that it's trying to upload a snapshot into a release repository</p>
  
  <pre class="lang-xml prettyprint-override"><code>jvm 1    | 2012-06-04 14:16:31 INFO  [tp1706427008-35] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Storing of item releases:/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120604.181534-1.tar.gz is forbidden by Maven Repository policy. Because releases is a RELEASE repository
  jvm 1    | 2012-06-04 14:16:31 ERROR [tp1706427008-35] - org.sonatype.nexus.rest.ContentPlexusResource - Got exception during processing request "PUT http://localhost:8081/nexus/content/repositories/releases/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120604.181534-1.tar.gz": Storing of item releases:/info/afilias/edr/edr-app/1.0.4-SNAPSHOT/edr-app-1.0.4-20120604.181534-1.tar.gz is forbidden by Maven Repository policy. Because releases is a RELEASE repository
  </code></pre>