top of page

How to setup a maven project in Jenkins (Allure, Cucumber and Extend reports) using Git on Mac

Sharing my experience in setting up a maven project in Jenkins that generates multiple reports - allure, cucumber and extent. Setting up this on a Mac machine was challenging for me due to the limited sources available over the internet while troubleshooting issues. Hope these learnings would be useful for you while navigating through the setups.

Introduction to Jenkins

Jenkins is an open source continuous integration/continuous delivery and deployment((CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.

How to install Jenkins

There are two methods for installing Jenkins on Mac. Choose the Homebrew method for a CLI-based installation or run Jenkins through Docker.

Install Jenkins Using the Homebrew Package Manager

Step 1: Install Homebrew

Homebrew is a macOS package manager that lets users install software using the CLI. Homebrew is not installed by default. To verify whether homebrew is installed or not, run the following command on terminal.

brew —version

The output should return the homebrew version installed. If not installed, we need to install hombrew first. Below documentation gives detailed installation steps.

Step 2: Install Java

JDK installation is required for Jenkins to work. To verify whether Java is installed or not, run the following command on terminal.

java -version

If Java not installed, install the latest Java by running the following command on terminal.

brew install java

We should see JDK exe file at /usr/bin/

Step 3: Install Jenkins

Run the following command to download and install Jenkins  LTS version through terminal,

brew install jenkins-lts

Step 4: Start Jenkins server

Run the following command in terminal to start the Jenkins sever.

brew services start jenkins-lts

After getting the successful started message on terminal, we can verify the sever is started properly by browsing to http://localhost:8080/. If its started properly, we will get a message box to type administrator password.

Below documentation shows step by step process to setup the user:

Step 5: Customize Jenkins

Select the Install suggested plugins to install all the most popular plugins. It will automatically install the most used plugins.

Step 6: Create Jenkins user

To create the first admin user, enter the required details like (username, password, email …) and click Save and Continue to proceed to the next step.

Step 7: Configure the Jenkins URL

The default URL is http://localhost:8080. To configure the Jenkins URL, click Save and Finish. We can change the default URL if we need. Now we can start using Jenkins.

Jenkins - Quick Tips

1. How to add plugins in Jenkins

In dashboard, select Manage Jenkins, then select Plugins. Since we are working on maven project, we need to select all plugins related to maven from the Available plugins and click install. 

Note: Install plugins for allure, extent and cucumber to generate the reports. 

2. Things to take care while doing installations in Jenkins

Dashboard -> Manage Jenkins -> Tools

We need to do 4 installations to make this work. Installations to be done are JDK, Git, Ant, and Maven. For each one, we need to do the same steps, give a name and either click install automatically or give the correct local path. Then, click apply and save.

JDK installation

It is critical to use the correct maven and java version while executing these maven projects. One of the main issue I faced during compile and run was “timeouts”. Screenshot below:

I tried lot of research to fix the issue but none of the responses really addressed this specific issue. In a nutshell, it was a version issue, that caused the timeouts Below are the steps that I followed to make it work:

1. Download maven from the link below:

2. Extract the zip in users folder.

3. Edit .zshrc file in your mac. If you do not have, you can create a file with extension .zshrc

 Contents for the .zshrc file:      

      JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home" (Put your own jdk path)


      export PATH


export M2_HOME="/Users/{userName}/apache-maven-3.9.5" (Put your own maven path)


    export PATH

Note: You can find the java installed in your system through this command: /usr/libexec/java_home -V

4. Verify the java home using the below command:  

$ java -version

5. Verify m2 home using the below command:

$ mvn -version

6. Try to run the mvn script through normal terminal and check the security setting in MAC whether it is blocking the execution. Click on Open Anyway.

7. Quit the terminal and save everything.

8. Run a fresh session and type mvn -v to check if you get the details of the maven installed. 

In Jenkins, use the correct version as below (use the correct path based on the idk version that you used in the above setups):

Git installation

Just provide default and path as git

Ant Installation

Install the latest version from Apache

Maven Installation

Use the correction path of the maven download from previous steps.

3. How to do configuration on each project

Once all the plugin installations and tool level setups are complete, just need to configure the project level settings. Hope you already have the maven project ready in git which can be executed in Jenkins now.. 

Dashboard > Select the project (Your own project that needs to be executed) > Configure

In the source code management:

Provide the URL from git. Copy paste the URL of the source code from git. Provide the credentials for git as well. Branch can be master if you have only one branch. 

Build trigger can be selected as below:

Critical step to list pom.xml and the goal which can be mentioned as “clean test”

All reports should be configured correctly based on the folders your program is writing out the reports. Double check the folders from program to ensure they are coming up accurately from Jenkins.

One of the challenge faced for extent report is “formatting” issue. This is an issue that can be fixed with some additional setups in Jenkins.

Goto Dashboard > Manage Jenkins > Script console. Type in below message and click RUN:


If you are getting a message “Result:” in the result section after run, just rerun the project and formatting will come accurately. 

This concludes the steps of the setup. Execute the project now!!

394 views1 comment

Recent Posts

See All

1 Comment

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Nov 10, 2023
Rated 5 out of 5 stars.

Well written and very useful article. 👏

bottom of page