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
16 days ago
C) stage('build') { steps { sh 'ant -f build-tools/build.xml -v' } }
upvoted 0 times
...
Melvin
21 days ago
B) stage('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...
Mitsue
22 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
Chana
2 days ago
User1: Thanks for the clarification, I'll go with option B) then. Yolo can wait for another time.
upvoted 0 times
...
Ahmad
3 days ago
User3: Yeah, User2 is right. You need to specify the build.xml file for the Ant command to work properly.
upvoted 0 times
...
Salome
17 days ago
User2: I think option B) stage('build') { sh 'ant -f build.xml -v' } is the correct syntax.
upvoted 0 times
...
Dannie
20 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
2 months ago
User 1: I think B) stage('build') { sh 'ant -f build.xml -v' } is the correct syntax.
upvoted 0 times
...
...
Mee
3 months ago
Hmm, I see your point. Let's double check the documentation before the exam.
upvoted 0 times
...
Pok
3 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