Jacoco maven config is not working

158 views
Skip to first unread message

Chathumal Sangeeth

unread,
Sep 27, 2023, 7:26:49 AM9/27/23
to JaCoCo and EclEmma Users
Hi all,
I tried several times to configure my maven test suite with jacoco. But after the run generated report always says

jacoco

No class files specified.


Here I will attach my pom.xml, Could anyone please help me? when I run mvn clean test it generates the report but when I open the index.html it returns above mentioned msg in the browser tab.

Appreciate your answer. If you can provide the correct config highly appreciate it.


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>jacoco</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-compiler.version>3.11.0</maven-compiler.version>
        <maven-surefire.version>3.1.2</maven-surefire.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>4.4.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire.version}</version>
                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.10</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Chathumal Sangeeth

unread,
Oct 6, 2023, 5:48:16 AM10/6/23
to JaCoCo and EclEmma Users
This issue was fixed. index.xml is not working in git actions. So I replaced index.html with jacoco.xml is working fine

金丁

unread,
Jan 17, 2024, 2:20:39 AMJan 17
to JaCoCo and EclEmma Users
how did you replaced index.html with jacoco.xml is working fine?

Chathumal Sangeeth

unread,
Jan 29, 2024, 3:19:38 AMJan 29
to JaCoCo and EclEmma Users
Hi  金丁
Reply all
Reply to author
Forward
0 new messages