Bird
0
0

You have this Jenkins pipeline snippet but it fails:

medium📝 Troubleshoot Q6 of 15
Spring Boot - Docker and Deployment
You have this Jenkins pipeline snippet but it fails:
pipeline {
  agent any
  stages {
    stage('Build')
      steps {
        echo 'Building app'
      }
  }
}

What is the syntax error causing the failure?
AMissing curly braces after stage declaration
BIncorrect agent specification
CUsing echo instead of sh command
DMissing pipeline keyword
Step-by-Step Solution
Solution:
  1. Step 1: Check stage syntax

    Stage must have curly braces enclosing steps block.
  2. Step 2: Identify missing braces

    In snippet, stage('Build') is not followed by braces before steps.
  3. Final Answer:

    Missing curly braces after stage declaration -> Option A
  4. Quick Check:

    Stage requires braces around steps [OK]
Quick Trick: Stage declaration must be followed by braces [OK]
Common Mistakes:
  • Omitting braces after stage name
  • Misplacing steps block
  • Confusing agent errors with syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes