title: How do I deploy to nexus (hosted by secureci)?
body: <p>Like recommended in <a href="https://stackoverflow.com/questions/1545520/how-to-setup-a-sophisticated-java-development-infrastructure/1545608#1545608">a previous SO-Answer</a> I'm running a VmWare image of <a href="http://www.coveros.com/research/research_stack.php" rel="nofollow noreferrer">secureci</a> as a preconfigured development infrastructure containing maven, nexus, hudson, svn.</p>
  
  <p>Now I want to configure maven on my Windows XP machine to deploy its artifacts to nexus. But when I configure my pom.xml like this (taken from <a href="http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/book/ch14s06.html" rel="nofollow noreferrer">Deploying Artifacts to Nexus</a>):</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;!-- use the following if you're not using a snapshot version. --&gt;
      &lt;repository&gt;
          &lt;id&gt;nexus&lt;/id&gt;
          &lt;name&gt;RepositoryProxy&lt;/name&gt;
          &lt;url&gt;scp://192.168.0.197/nexus/content/repositories/releases&lt;/url&gt;
      &lt;/repository&gt;
      &lt;!-- use the following if you ARE using a snapshot version. --&gt;
      &lt;snapshotRepository&gt;
          &lt;id&gt;nexus&lt;/id&gt;
          &lt;name&gt;RepositoryProxy&lt;/name&gt;
          &lt;url&gt;scp://192.168.0.197/nexus/content/repositories/snapshots&lt;/url&gt;
      &lt;/snapshotRepository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>... <code>mvn deploy</code> prints the error message:</p>
  
  <pre><code>Error deploying artifact: Exit code: 1 - 
      mkdir: cannot create directory `/nexus': Permission denied
  </code></pre>
  
  <p>In <code>settings.xml</code> I configured username and password like this:</p>
  
  <pre><code>&lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;nexus&lt;/id&gt;
      &lt;username&gt;tangens&lt;/username&gt;
      &lt;password&gt;********&lt;/password&gt;
    &lt;/server&gt;
  &lt;/servers&gt;
  </code></pre>
  
  <p><strong>Question:</strong> What configuration do I have to use for deploying to nexus?</p>
  
  <hr>
  
  <p>I already tried <code>https</code> instead of <code>scp</code>, but with this maven ran into problems with missing certificates.</p>
  
  <p>I tried <code>http</code> instead of <code>scp</code>, but secureci has a firewall installed to block access to port 80 (http), causing a timeout.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I found that nexus stores its artifacts at <code>/root/sonatype-work/nexus/storage/snapshots/</code>. But I don't like the idea to enter the credentials of the root account in my <code>settings.xml</code>.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <blockquote>
    <p><strong>Q:</strong> Did you enabled deployment for a hosted repository under Nexus?</p>
  </blockquote>
  
  <p>Yes, it's enabled by default.</p>
  
  <blockquote>
    <p><strong>Q:</strong> Is Nexus listening on port 80?</p>
  </blockquote>
  
  <p>There is an apache running on port 80.
  <code>Server: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_wsgi/1.3 Python/2.5.2</code></p>
  
  <blockquote>
    <p><strong>Q:</strong> If a firewall is not allowing HTTP, why don't you just add an exception for HTTP connections from the "host" IP?</p>
  </blockquote>
  
  <p>Because I assumed SecureCI is well configured and there should be a way to do it without tweaking the installation. But perhaps I'm too naive here.</p>