Bird
0
0

You wrote this Jenkins pipeline snippet:

medium📝 Troubleshoot Q14 of 15
Spring Boot - Docker and Deployment
You wrote this Jenkins pipeline snippet:
stage('Build') {
  sh 'mvn clean package'
}

But Jenkins shows an error. What is the likely cause?
AMissing steps block inside the stage
BWrong shell command syntax
CAgent not specified in pipeline
DMaven is not installed on Jenkins server
Step-by-Step Solution
Solution:
  1. Step 1: Check Jenkins stage syntax

    Each stage must contain a steps { ... } block to run commands.
  2. Step 2: Identify missing steps block

    The snippet lacks steps { }, causing Jenkins syntax error.
  3. Final Answer:

    Missing steps block inside the stage -> Option A
  4. Quick Check:

    Jenkins stage needs steps block [OK]
Quick Trick: Always wrap commands inside steps { } in Jenkins stage [OK]
Common Mistakes:
  • Omitting steps block inside stage
  • Assuming shell command syntax is wrong
  • Ignoring agent requirement (not error here)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes