Clone the below repository
https://gitlab.com/ramansharma95/test.git
Go to Gitlab Project and Go to Settings --> CICD --> General Pipeline
In the test coverage parsing add below expression
Total.*?([0-9]{1,3})%
Go to General Settings ---> Badges
Badge name is Coverage
Link
https://gitlab.com/ramansharma95/%{project_path}/badges/%{default_branch}/coverage.svg
Badge Image URL
https://gitlab.com/%{project_path}/badges/%{default_branch}/coverage.svg?style=flat
Go to test folder
mvn clean package command
go to target/site/jacoco/index.html