Skip to content

Java coverage not present in HTML report #108

Closed as not planned
Closed as not planned
@ilmirons

Description

@ilmirons

Hi. I have a project with Java and Scala sources, but scoverage report shows only Scala classes coverage. Here is the layout of the project and a pom.xml snippet. Note that Scala test cover both Java and Scala file. Is this a bug? Is there a way to have my Java coverage rendered in HTML by the plugin?

.
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── example
│   │   │           ├── AnotherFile.java
│   │   │           └── ...
│   │   ├── resources
│   │   └── scala
│   │       └── com
│   │           └── example
│   │             ├──File.scala
│   │             └── ...
│   └── test
│       ├── resources
│       └── scala
│           └── com
│               └── example
│                   ├── FileSpec.scala
│                   └── ...
└── target
    ├── cobertura.xml
    └── ...
<build>
<plugins>
    <!-- ... -->
    <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.10.1</version>
              <configuration>
                  <release>17</release>
              </configuration>
              <executions>
                  <execution>
                      <phase>compile</phase>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>net.alchim31.maven</groupId>
              <artifactId>scala-maven-plugin</artifactId>
              <version>4.8.0</version>
              <configuration>
                  <scalaVersion>${scala.version}</scalaVersion>
              </configuration>
              <executions>
                  <execution>
                      <id>scala-compile-first</id>
                      <phase>process-resources</phase>
                      <goals>
                          <goal>add-source</goal>
                          <goal>compile</goal>
                      </goals>
                  </execution>
                  <execution>
                      <id>scala-test-compile</id>
                      <phase>process-test-resources</phase>
                      <goals>
                          <goal>testCompile</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <!-- disable surefire -->
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.7</version>
              <configuration>
                  <skipTests>true</skipTests>
              </configuration>
          </plugin>
          <!-- enable scalatest -->
          <plugin>
              <groupId>org.scalatest</groupId>
              <artifactId>scalatest-maven-plugin</artifactId>
              <version>2.2.0</version>
              <configuration>
                  <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                  <junitxml>.</junitxml>
                  <filereports>WDF TestSuite.txt</filereports>
              </configuration>
              <executions>
                  <execution>
                      <id>test</id>
                      <goals>
                          <goal>test</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.scoverage</groupId>
              <artifactId>scoverage-maven-plugin</artifactId>
              <version>${scoverage.plugin.version}</version>
              <configuration>
                  <scalaVersion>${scala.version}</scalaVersion>
                  <aggregate>true</aggregate>
              </configuration>
          </plugin>
    <!-- ... -->
</plugins>
</build>
<reporting>
        <plugins>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>integration-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

Thanks for your work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions