Can we invoke ant file for pipeline in jenkins using a Jenkinsfile

0 votes
Feb 6, 2020 in Jenkins by anonymous
• 19,610 points
5,080 views

1 answer to this question.

0 votes

Yes, you can do it.

You need to specify the following in the jenkinsfile.

def antVersion = 'Ant1.9.1'
withEnv( ["ANT_HOME=${tool antVersion}"] ) {
    sh '$ANT_HOME/bin/ant target1 target2'
}

Hope this helps!

answered Feb 6, 2020 by Sirajul
• 59,230 points

Related Questions In Jenkins

0 votes
1 answer

What is the use of using declarative pipeline (i.e jenkins file) over scripted pipeline in real time

Hi@Shashi, The declarative pipeline is a relatively new ...READ MORE

answered Oct 28, 2020 in Jenkins by MD
• 95,460 points
1,549 views
+4 votes
7 answers

How to set the pipeline name and description for a Jenkinsfile?

You can rename pipeline jobs in jenkins ...READ MORE

answered Oct 11, 2018 in Jenkins by Hannah
• 18,520 points
36,373 views
0 votes
2 answers
+5 votes
3 answers

How to trigger a Jenkins pipeline A in another Jenkins pipeline B?

You can run the following code, its ...READ MORE

answered Jul 5, 2018 in Jenkins by Sophie may
• 10,620 points
119,670 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,039 views
+2 votes
1 answer
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP