'Unable to generate maven cucumber report

I am trying to generate html report using maven-cucumber-reporting plugin. I am using configuration in my pom.xml, but it is not running this plugin to generate the report. I have maven goals "mvn clean verify". I am using cucumber version 6.11.0

    <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven 
            defaults (may be moved to parent pom) -->
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.1</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>${project.basedir}//testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>

            <plugin>
                <groupId>net.masterthought</groupId>
                <artifactId>maven-cucumber-reporting</artifactId>
                <version>5.7.0</version>
                <executions>
                    <execution>
                        <id>execution</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <projectname>Cucumber-jvm-example</projectname>
                            <outputdirectory>${project.build.directory}/cucumber-html-reports</outputdirectory>
                            <cucumberoutput>${project.build.directory}/cucumber-reports/cucumber.json</cucumberoutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

My cucumberOptions class look like below

    package com.automation.cucumber;

import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.*;
import org.testng.annotations.DataProvider;

    @CucumberOptions(features = "features"
            , glue = "com.automation.cucumber"
            , tags = "@Alerts"
            , plugin = {"json:target/cucumber-reports/cucumber.json"})
    
    public class CucumberOption extends AbstractTestNGCucumberTests {
    
        @DataProvider(parallel = true)
        public Object[][] scenarios() {
            return super.scenarios();
        }
    
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source