Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - 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
1 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
Melvin
21 hours ago
B) stage('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...
Mitsue
2 days ago
A) step('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...
...
Leslee
1 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
1 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
...
Truman
1 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
23 days 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
28 days 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
2 months ago
I think the correct syntax is B) stage('build') { sh 'ant -f build.xml -v' }
upvoted 0 times
...

Save Cancel