0
0
Jenkinsdevops~10 mins

Build tools (Maven, Gradle, npm) in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run a Maven build in a Jenkins pipeline.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh 'mvn [1]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Acompile
Btest
Cclean install
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'clean install' when only compilation is needed.
Using 'test' which runs tests but does not compile separately.
2fill in blank
medium

Complete the code to run a Gradle build task in a Jenkins pipeline.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh './gradlew [1]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aassemble
Bbuild
Cclean
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'assemble' which only packages without running tests.
Using 'clean' which deletes build files but does not build.
3fill in blank
hard

Fix the error in the npm build command in this Jenkins pipeline.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh 'npm [1]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Abuild
Binstall
Crun build
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm build' which is not a valid npm command.
Using 'npm start' which runs the start script, not build.
4fill in blank
hard

Fill both blanks to run a Maven clean and package in a Jenkins pipeline.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh 'mvn [1] [2]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aclean
Binstall
Cpackage
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' instead of 'package' which also installs to local repo.
Using 'test' which only runs tests.
5fill in blank
hard

Fill all three blanks to run a Gradle clean, build, and test in a Jenkins pipeline.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build and Test') {
      steps {
        sh './gradlew [1] [2] [3]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aclean
Bbuild
Ctest
Dassemble
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'assemble' instead of 'build' which does not run tests.
Omitting 'clean' which may cause stale files.