I have a zip file which contains version like this xxx_1.2.3.zip
now i created one jenkins
job which will run and upload the zip in nexus using build.xml
.
My question is i want to unzip and find the war file and want to upload zip and war file to nexus
.i am able to do using below code but it is not storing the war
file with its original name artifact id and group id.Zip contains yyy.war
.when i stores to nexus it should upload like yyy_1.2.3.war.But is is storing as xxx-jenkins
build number.war
.
Please help .Thanks in advance.
unzip ${xxx_ReleaseVersion}
echo "<project> <modelVersion>4.0.0</modelVersion><groupId>zzz</groupId> <artifactId>xxx</artifactId> <version>${BUILD_NUMBER} </version> <packaging>pom</packaging> </project>" > pom.xml
echo "<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<project basedir="." name="xxx" default="deploy" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<artifact:pom id="mypom" file="pom.xml" />
<target name="deploy">
<artifact:deploy file="pom.xml">
<remoteRepository url="https://URL/nexus/content/repositories/xxx">
<authentication username="xxxx" password="1234" />
</remoteRepository>
<pom refid="mypom"/>
<attach file="${xxx_ReleaseVersion}" type="zip"/> " > build.xml
find . -type f -name "*.war" -exec echo "<attach file="{}"type="war"/> " >> build.xml ;
echo "</artifact:deploy>
</target>
</project> " >> build.xml
pwd
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…