There are some similar questions in the past, but I either don't see any valid answer or in a different situation. My project is a pure Scala project managed by maven. While the POM file is rather big, I'd only pick some relevant snippets:
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<!--args>
<arg>-target:jvm-1.8</arg>
</args-->
</configuration>
</plugin>
<!-- disable surefire -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- enable scalatest -->
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<htmlreporters>${project.build.directory}/html/scalatest</htmlreporters>
<forkMode>once</forkMode>
</configuration>
<executions>
<execution>
<id>scala-test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
......
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.4.11</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<aggregate>true</aggregate>
</configuration>
<executions>
<execution>
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
Then I run mvn clean scoverage:report, from the log, the instrumented class generated:
[INFO] Compiling 259 source files to <I removed project name>/target/scoverage-classes at 1678344142307
Unit tests ran:
Run completed in 1 second, 130 milliseconds.
Total number of tests run: 8
Suites: completed 3, aborted 0
Tests: succeeded 8, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
Then it skipped report generation:
[INFO] <<< scoverage:1.4.11:report (default-cli) < [scoverage]test @ spark-pipelines <<<
[INFO]
[INFO]
[INFO] --- scoverage:1.4.11:report (default-cli) @ spark-pipelines ---
[INFO] Skipping SCoverage report generation
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:13 min
[INFO] Finished at: 2023-03-09T17:43:22+11:00
From target folder, I can see there is only one file source.roots generated in coverage-data folder. There is no site folder generated.
In order to reproduce this issue, I created a very simple Scala project, and the pom file is like this:
And the mvn output is: