Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CloudBees Exam CJE Topic 1 Question 88 Discussion

Actual exam question for CloudBees's CJE exam
Question #: 88
Topic #: 1
[All CJE Questions]

You're a DevOps engineer in charge of configuring Jenkins for your team's CI/CD pipeline. You're utilizing the Jenkins pipeline and the Jenkinsfile. You want to define a stage for your build that utilizes the locally installed Ant and build.xml in the root of your project repository. Which is the correct syntax?

Show Suggested Answer Hide Answer
Suggested Answer: C

When a build breaks, fixing it should be the priority of everyone on the project


Contribute your Thoughts:

Merlyn
2 months ago
Wait, is Ant even a real build tool? I thought we were supposed to be using Gradle these days. *scratches head*
upvoted 0 times
Jacquelyne
12 days ago
C) stage('build') { steps { sh 'ant -f build-tools/build.xml -v' } }
upvoted 0 times
...
Melvin
17 days ago
B) stage('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...
Mitsue
18 days ago
A) step('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...
...
Leslee
2 months ago
B) and D) both look like they'll get the job done. I'm gonna go with D) because it seems a bit more explicit with the steps block.
upvoted 0 times
...
Hannah
2 months ago
Hmm, I'm not sure. Maybe I should just use the 'ant' command without the build.xml file and see what happens? Yolo!
upvoted 0 times
Salome
13 days ago
User2: I think option B) stage('build') { sh 'ant -f build.xml -v' } is the correct syntax.
upvoted 0 times
...
Dannie
16 days ago
User1: Don't risk it, you should specify the build.xml file in your Jenkins pipeline.
upvoted 0 times
...
...
Truman
2 months ago
D) stage('build') { steps { sh 'ant -f build.xml -v' } } is the way to go. Enclosing the Ant command in the steps block is the correct syntax.
upvoted 0 times
...
Grover
2 months ago
B) stage('build') { sh 'ant -f build.xml -v' } looks good to me. It directly specifies the build stage and runs the Ant command on the build.xml file.
upvoted 0 times
Donte
1 months ago
User 2: Yeah, that looks good. It specifies the build stage and runs the Ant command on the build.xml file.
upvoted 0 times
...
Earleen
1 months ago
User 1: I think B) stage('build') { sh 'ant -f build.xml -v' } is the correct syntax.
upvoted 0 times
...
...
Mee
2 months ago
Hmm, I see your point. Let's double check the documentation before the exam.
upvoted 0 times
...
Pok
2 months ago
I disagree, I believe it's D) stage('build') { steps { sh 'ant -f build.xml -v' } }
upvoted 0 times
...
Mee
3 months ago
I think the correct syntax is B) stage('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77