Recall & Review
beginner
What is the purpose of the
tools directive in Jenkins pipelines?The
tools directive tells Jenkins which software tools (like JDK, Maven, or Gradle) to install and use during the pipeline run.Click to reveal answer
beginner
How do you specify a JDK version using the
tools directive in a Jenkins pipeline?You specify it like this:<br>
tools {<br> jdk 'JDK11'<br>}<br>This tells Jenkins to use the JDK named 'JDK11' configured in Jenkins.Click to reveal answer
intermediate
Can the
tools directive install multiple tools at once?Yes, you can list multiple tools inside the
tools block, for example:<br>tools {<br> jdk 'JDK11'<br> maven 'Maven3'<br>}Click to reveal answer
intermediate
What happens if the tool specified in the
tools directive is not installed on the Jenkins agent?Jenkins will automatically download and install the specified tool version on the agent before running the pipeline steps.
Click to reveal answer
beginner
Where do you configure the tool versions that can be used in the
tools directive?Tool versions are configured in Jenkins global configuration under 'Global Tool Configuration'. This is where you define names like 'JDK11' or 'Maven3'.
Click to reveal answer
What does the Jenkins
tools directive do in a pipeline?✗ Incorrect
The
tools directive tells Jenkins which software tools to prepare for the pipeline.How do you specify Maven version 'Maven3' in the
tools directive?✗ Incorrect
The correct syntax is
tools { maven 'Maven3' }.If a tool is not installed on the Jenkins agent, what happens when specified in
tools?✗ Incorrect
Jenkins downloads and installs missing tools automatically before running the pipeline.
Where do you define the names like 'JDK11' used in the
tools directive?✗ Incorrect
Tool names and versions are set in Jenkins under Global Tool Configuration.
Can you specify multiple tools in one
tools block?✗ Incorrect
You can list multiple tools like JDK and Maven inside one
tools block.Explain how the Jenkins
tools directive helps manage software dependencies in a pipeline.Think about how Jenkins prepares the environment for your build.
You got /4 concepts.
Describe the steps to configure and use a new JDK version in Jenkins pipelines using the
tools directive.Start from Jenkins settings, then pipeline usage.
You got /4 concepts.