title: Pushing artifacts to the Nexus using Jenkins maven-release-plugin
body: <p>In my Jenkins dashboard, I'm using <strong>maven-release-plugin (v0.16.2)</strong> to perform a maven release to Nexus repository. I have some issues while using this plugin.</p>
  <p><a href="https://i.stack.imgur.com/0Fkgz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Fkgz.png" alt="enter image description here" /></a></p>
  <p><strong>Issue 1:</strong></p>
  <p>As shown in the image, it uses <code>&lt;project_name&gt;-&lt;release_version&gt;</code> as the SCM default tag. But I want to change it as <code>v&lt;release_version&gt;</code> value. Therefore, I have added the following change into my project pom.xml file's plugin section.</p>
  <pre><code>&lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                    &lt;tagNameFormat&gt;v@{project.version}&lt;/tagNameFormat&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
    &lt;/build&gt;
  </code></pre>
  <p>But still, it uses the aforementioned default tag. Is there any other configuration I have to do in Jenkins or pom.xml file?</p>
  <p><strong>Issue 2:</strong></p>
  <p>I have configured my pom.xml file with <code>distributionManagement</code> section to push my built artifact to the Nexus repository as follows.</p>
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;releases&lt;/id&gt;
        &lt;name&gt;Release Distribution Repository&lt;/name&gt;
        &lt;url&gt;http://localhost:8081/nexus/content/repositories/releases/&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/distributionManagement&gt;
  </code></pre>
  <p>With this configuration, Jenkins pushes all the project built artifacts (packaging JAR artifact + dependency XML artifacts in M2) to the given Nexus repository successfully. But in my case, I want to deploy only the JAR file to the Nexus repository (excluding other dependency XML files). Is it possible to do with this Jenkins maven release plugin? Deploy only a specific file or directory?</p>