0
votes

I am using ANT to build artifacts(finally all artifacts will be zipped in one zip file) and jenkins plugin 'Nexus Artifact Uploader' to upload artifact to nexus repository.

I want to download the artifact(zip file) from nexus repository using ANT OR jenkins plugin only. I am not supposed to use maven for this task. Also, unix commands like 'wget' or 'curl' are not allowed in my deployment environment. It fails with permission denied error. So, I want solution using either ANT or jenkins plugin only.

Can anyone please help.

1
I am sorry, I forgot to mention that unix commands like 'wget' or 'curl' are not allowed in my deployment environment. It fails with permission denied error. So, I want solution using either ANT or jenkins plugin.Ranjeet
are you using jenkins pipelines or old fashion jenkins jobs ?BigGinDaHouse
I am using old fashion jenkins job as it is not that complex project. I have a job to build and upload artifacts to nexus. And this second job will download these artifacts and upload to target runtime. But there is almost no possibility of executing deployment job after completing build job. Deployment job will be executed less frequently compared to build job. So there won't be any pipeline here.Ranjeet
I see, if you can use jenkins2.0 Jenkinsfiles (aka pipelines) it will give you possibility to download from nexus via clean Groovy code, which will make your life easier.BigGinDaHouse

1 Answers

1
votes

You can use below ant project snippet to download artifacts from nexus

<project name="testdown" default="dependencies" basedir=".">
 <target name="dependencies">
<mkdir dir="libraries" />
<get src="http://10.135.155.72:8081/repository/maven-central/log4j/log4j/1.2.9/log4j-1.2.9.jar" dest="liblibraries/log4j-1.2.9.jar" usetimestamp="true" />
</target>
</project>