Using a sample pipeline for execution
Jenkins provides syntax to get a feel for how to configure a pipeline.
Getting ready
With Jenkins 2, the pipeline and other features are installed with the default installation with the suggested plugins.
How to do it...
- Go to the Jenkins dashboard |
New item
|Pipeline
. - It will open the configuration of a newly created pipeline job.
- Go to the
Pipeline
section:

- In the
try sample Pipeline...
dropdown, selectGitHub + Maven
. It will automatically generate the syntax for the sample code. Make sure thatmvnHome
has the proper value as per the path given for Maven in your system:

- Click on
Save
and execute the build to verify it. - However, you will create your own pipeline with the same sequence you tried with the
Build Pipeline
plugin in the next recipe.