How to deploy a 3rd party set of libs to Nexus
<p>I want to deploy a 3rd party set of libraries to nexus after building them from the source using maven.</p>

<p>I thought I'd be able to simply use <code>mvn deploy</code> but I get the following message:</p>

<pre><code>[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ dcm4che-parent ---
Uploading: scp://www.dcm4che.org:443/home/maven2/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom
The authenticity of host 'www.dcm4che.org' can't be established.
RSA key fingerprint is 41:7f:10:be:8d:15:30:f1:91:59:95:c7:5d:63:f7:31.
Are you sure you want to continue connecting? (yes/no): yes
Password: :
</code></pre>

<p>This looks to me like it's trying to deploy to the www.dcm4che.org and not my nexus repo. </p>

<p>Can I not use <code>mvn deploy</code> in this way? </p>

<p>I can deploy my own libs to nexus this way without any problems.</p>

<p>What am I doing wrong?</p>

<p><strong>UPDATE</strong></p>

<p>After following the advice in <a href="https://stackoverflow.com/a/37995279/820657">this answer</a> I executed the following command:</p>

<pre><code>mvn deploy -DaltDeploymentRepository=nexus::default::http://192.168.50.200:8081/nexus/content/repositories/thirdparty
</code></pre>

<p>and I get the following error:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not transfer artifact org.dcm4che:dcm4che-parent:pom:3.3.7 from/to nexus (http://192.168.50.200:8081/nexus/content/repositories/thirdparty): Failed to transfer file: http://192.168.50.200:8081/nexus/content/repositories/thirdparty/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom. Return code is: 401, ReasonPhrase: Unauthorized. -&gt; [Help 1]
</code></pre>

<p>I have added an entry in my <code>settings.xml</code> as follows:</p>

<pre><code>&lt;servers&gt;
    &lt;server&gt;
        &lt;id&gt;thirdparty&lt;/id&gt;
        &lt;username&gt;deployment&lt;/username&gt;
        &lt;password&gt;password&lt;/password&gt;
        &lt;configuration&gt;&lt;/configuration&gt;
    &lt;/server&gt;
&lt;/servers&gt;
</code></pre>

<p><strong>2nd UPDATE</strong></p>

<p>I have tried the following command line variations but still can't get it to work. The maven documentation isn't any help.</p>

<pre><code>mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081
</code></pre>

<p>produces the error:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not find artifact org.dcm4che:dcm4che-parent:pom:3.3.7 in thirdparty (http://192.168.50.200:8081) -&gt; [Help 1]
</code></pre>

<p>and</p>

<pre><code>mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081/nexus/
</code></pre>

<p>produces the error:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not transfer artifact org.dcm4che:dcm4che-parent:pom:3.3.7 from/to thirdparty (http://192.168.50.200:8081/nexus/): Failed to transfer file: http://192.168.50.200:8081/nexus/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom. Return code is: 405, ReasonPhrase: HTTP method PUT is not supported by this URL. -&gt; [Help 1]
</code></pre>

<p>and</p>

<pre><code>mvn deploy -DaltDeploymentRepository=nexus::default::http://192.168.50.200:8081/nexus/content/repositories/
</code></pre>

<p>produces the error:</p>

<pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not find artifact org.dcm4che:dcm4che-parent:pom:3.3.7 in nexus (http://192.168.50.200:8081/nexus/content/repositories/) -&gt; [Help 1]
</code></pre>

<p><strong>Final UPDATE</strong></p>

<p>For anyone else who might stumble across this, the following command worked. Thanks to A_Di-Matteo for his help.</p>

<pre><code>mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081/nexus/content/repositories/thirdparty
</code></pre>