title: Uploading war file to Nexus using jenkins job
body: <p>I have a zip file which contains version like this <code>xxx_1.2.3.zip</code> now i created one <code>jenkins</code> job which will run and upload the zip in nexus using <code>build.xml</code>.</p>
  
  <p>My question is i want to unzip and find the war file and want to upload zip and war file to <code>nexus</code>.i am able to do using below code but it is not storing the <code>war</code> file with its original name artifact id and group id.Zip contains <code>yyy.war</code>.when i stores to nexus it should upload like yyy_1.2.3.war.But is is storing as <code>xxx-jenkins</code> build <code>number.war</code>.</p>
  
  <p>Please help .Thanks in advance.</p>
  
  <pre><code> unzip ${xxx_ReleaseVersion}
   echo "&lt;project&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;&lt;groupId&gt;zzz&lt;/groupId&gt; &lt;artifactId&gt;xxx&lt;/artifactId&gt; &lt;version&gt;${BUILD_NUMBER}  &lt;/version&gt;       &lt;packaging&gt;pom&lt;/packaging&gt; &lt;/project&gt;" &gt; pom.xml
   echo "&lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"no\"?&gt;
   &lt;project basedir=\".\" name=\"xxx\" default=\"deploy\"    xmlns:artifact=\"antlib:org.apache.maven.artifact.ant\"&gt;
   &lt;artifact:pom id=\"mypom\" file=\"pom.xml\" /&gt;
   &lt;target name=\"deploy\"&gt;       
   &lt;artifact:deploy file=\"pom.xml\"&gt;
   &lt;remoteRepository url=\"https://URL/nexus/content/repositories/xxx\"&gt;
      &lt;authentication username=\"xxxx\" password=\"1234\" /&gt;
   &lt;/remoteRepository&gt;
   &lt;pom refid=\"mypom\"/&gt; 
   &lt;attach file=\"${xxx_ReleaseVersion}\" type=\"zip\"/&gt; " &gt; build.xml
   find . -type f -name "*.war" -exec echo "&lt;attach file=\"{}\"type=\"war\"/&gt; "   &gt;&gt; build.xml \;
   echo "&lt;/artifact:deploy&gt;
   &lt;/target&gt;
   &lt;/project&gt;  " &gt;&gt; build.xml
  
    pwd
  </code></pre>