title: How to deploy an arbitrary binary to Nexus with maven
body: <p>I think I have run in to a maven deploy plugin bug, but I want to confirm that I am not doing it wrong before I open a bug report and start grepping through source.</p>
  
  <p>I am trying to deploy an arbitrary binary (tar.gz,jar,box,etc) to a maven repository.
  The user I am using is in the settings.xml file with a plaintext password.
  The user is in an LDAP group that is connected to nexus with a Role.</p>
  
  <p>That role has 3 privileges associated with it.  Update, Create, Read which are in turn associated with the repository target.</p>
  
  <p>Now using wget the user can pull data from the repo, and using this curl command I can deploy to the repo:</p>
  
  <pre><code>curl --request PUT --user USERNAME:PASSWORD https://NEXUS_URL/nexus/content/repositories/REPO_NAME/path/to/file/with/groupid/version/iamafile.jar \
  --data @./iamafile.jar  -H Content-Type:application/java-archive --verbose
  </code></pre>
  
  <p>This works fine, http 201 and the file is added.  When I use a similiar mvn deploy command:</p>
  
  <pre><code>mvn deploy:deploy-file --settings /path/to/settings.xml \
  -Durl=https://NEXUS_URL/nexus/content/repositories/REPOSITORYID -Dfile=iamafile.jar \
  -DrepositoryId=REPOSITORYID -DartifactId=ARTIFACTID -DgroupId=GROUPID \
  -Dversion=VERSION
  </code></pre>
  
  <p>I get an http 401 unauthorized error.</p>
  
  <p>There have been <a href="https://issues.sonatype.org/browse/NEXUS-3048" rel="nofollow">multiple</a> <a href="http://jira.codehaus.org/browse/MNG-4469" rel="nofollow">bug</a> reports about this, but they supposedly have been fixed.
  With a pom file with the same values for version, artifcatId, etc.  <code>mvn deploy</code> works fine.</p>
  
  <p>Have I found a bug, or am I using it improperly?</p>
  
  <p>Edit:</p>
  
  <p>I opened up <a href="http://jira.codehaus.org/browse/MDEPLOY-155?page=com.atlassian.jira.plugin.system.issuetabpanels%3aall-tabpanel" rel="nofollow">this</a> bug regarding the issue.
  If the dev's end up saying that it isn't a bug, I will add that as an answer if someone hasn't beat me to it.</p>