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

0 votes
Feb 6 in Jenkins by anonymous
• 9,300 points
40 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 by Sirajul
• 48,530 points

Related Questions In Jenkins

+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,030 points
10,790 views
0 votes
2 answers
+2 votes
2 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
• 9,940 points
10,872 views
0 votes
2 answers
+13 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,400 points
352 views
0 votes
1 answer
+1 vote
1 answer