Deployment failed: repository element was not specified in the POM inside distributionManagement element
<p>I am trying out this example (<a href="https://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/" rel="nofollow">https://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/</a>) in intelliJ using maven. I am able to install the project but deploy gives this error.   </p>

<pre><code>Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-cli) on project RESTfulExample: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -&gt; [Help 1]
</code></pre>

<p>Does anyone know what am I missing here? Do I need to add anything else to make it deploy? </p>

<p>Below is my POM file</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/maven-v4_0_0.xsd"&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.konrad.common&lt;/groupId&gt;
&lt;artifactId&gt;RESTfulExample&lt;/artifactId&gt;
&lt;packaging&gt;war&lt;/packaging&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;name&gt;RESTfulExample Maven Webapp&lt;/name&gt;
&lt;url&gt;http://maven.apache.org&lt;/url&gt;

&lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;maven2-repository.java.net&lt;/id&gt;
        &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
        &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
        &lt;layout&gt;default&lt;/layout&gt;
    &lt;/repository&gt;
&lt;/repositories&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.8.2&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
        &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
        &lt;version&gt;1.8&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
        &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
        &lt;version&gt;2.0&lt;/version&gt;
    &lt;/dependency&gt;

&lt;/dependencies&gt;

&lt;build&gt;
    &lt;finalName&gt;RESTfulExample&lt;/finalName&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;source&gt;1.6&lt;/source&gt;
                &lt;target&gt;1.6&lt;/target&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;

&lt;distributionManagement&gt;
    &lt;repository&gt;
        &lt;id&gt;localSnap&lt;/id&gt;
        &lt;name&gt;RepositoryProxyRel&lt;/name&gt;
        &lt;url&gt;http://127.0.0.1:8080/nexus/content/repositories/releases/&lt;/url&gt;
    &lt;/repository&gt;
    &lt;snapshotRepository&gt;
        &lt;id&gt;MylocalSnap&lt;/id&gt;
        &lt;name&gt;RepositoryProxySnap&lt;/name&gt;
        &lt;url&gt;http://127.0.0.1:8080/nexus/content/repositories/snapshots/&lt;/url&gt;
    &lt;/snapshotRepository&gt;
&lt;/distributionManagement&gt;
</code></pre>

<p></p>