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

0 votes
Feb 6, 2020 in Jenkins by anonymous
• 19,590 points
2,250 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,030 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,140 points
218 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,550 points
23,518 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,550 points
44,954 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,034 views
+2 votes
1 answer
+1 vote
1 answer