title: How can I make maven deploy artifacts to the home directory on a remote server without specifying it?
body: <p>I'm able to deploy my project to my remote server like this:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
      &lt;artifactId&gt;myproject&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;extensions&gt;
              &lt;extension&gt;
                  &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
                  &lt;artifactId&gt;wagon-ssh-external&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0&lt;/version&gt;
              &lt;/extension&gt;
          &lt;/extensions&gt;
      &lt;/build&gt;
  
      &lt;distributionManagement&gt;
          &lt;repository&gt;
              &lt;id&gt;internal&lt;/id&gt;
              &lt;url&gt;scpexe://maven@myserver.com/home/maven&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/distributionManagement&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>But (as you can see) I'm forced to specify the home directory of the <code>maven</code> user on my server. Usually when I use <code>scp</code> I can simply use <code>scp somefile.txt me@myserver.com:</code> and the file is transferred to the <strong>home</strong> directory of the user on my server. But if I try something similar in the <code>pom.xml</code>:</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;internal&lt;/id&gt;
          &lt;url&gt;scpexe://maven@myserver.com:&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>I get this error message:</p>
  
  <pre><code>Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: For input string: "" -&gt; [Help 1]
  </code></pre>
  
  <p>If I try this:</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;internal&lt;/id&gt;
          &lt;url&gt;scpexe://maven@myserver.com&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>then Maven tries creating the repo structure and deploying the artifact directly to the server root directory. So I get this error message:</p>
  
  <pre><code>Error executing command for transfer: Exit code 1 - mkdir: cannot create directory ‘//com’: Permission denied -&gt; [Help 1]
  </code></pre>
  
  <p>Is there a way to specify the maven repository as residing in the users home directory without having to manually specify where the home directory is?</p>