1. Install the Blue Ocean Plugin
- Navigate to Manage Jenkins → Plugin Manager → Available.
- Search for blueocean, select the plugin bundle, and click Install without restart.
Blue Ocean requires Jenkins 2.x and the Pipeline plugin. Ensure your instance meets these prerequisites before installation.



2. Launch Blue Ocean and Create a New Pipeline
- Click Open Blue Ocean → New Pipeline.
- Select Git, enter your repository URL, and add credentials if needed.
- Blue Ocean will scan branches for a
Jenkinsfileand automatically trigger the pipeline if found.


3. Example Jenkinsfile and Stage Overview
Below is the sample Jenkinsfile stored in your repository. It defines three key stages:
After triggering the pipeline, you can monitor each stage in real time:

Viewing Console Logs
Echo Version stage output:
4. Inspect the Multibranch Pipeline Configuration
Blue Ocean automatically creates a Multibranch Pipeline job in the classic UI:
5. Edit the Pipeline in Blue Ocean
Back in Blue Ocean:- Select your branch and click the pencil icon to open the visual editor.
- Remove the sleep loop in Unit Test to simplify:
Jenkinsfile.
6. Archive Build Artifacts
- In the Build stage, click + Add Step → Archive Artifacts.
- Enter the file pattern:
target/hello-demo-*.jar.
7. Publish JUnit Test Results
The JUnit plugin is pre-installed, as shown here:
- Edit the Unit Test stage → + Add Step → Archive JUnit-formatted test results.
- Enter
target/surefire-reports/TEST-*.xmland select Keep properties and Keep test names.
8. Commit and Validate Changes
Click Save, add a commit message (e.g., “Archive artifacts and publish JUnit reports”), and push to themain branch:

If you mistype the artifact pattern (for example, Double-check your paths before committing.
hello-world-*.jar), the build will fail:9. View Pipeline Results
Once the pipeline completes successfully, Blue Ocean displays:- Build stage with archived artifacts
- Unit Test stage with pass/fail details
- A summary showing all tests passed

