Domanda

I have difficulties with configuring Cobertura code-coverage tool in Jenkins to work with mixed Java/Scala project. Java classes works ok, but Cobertura don't analyze Scala tests.

Scala-specific configuration in my pom.xml:

<version.scala.plugin>3.1.0</version.scala.plugin>
<build>
<plugins>
        <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                </configuration>
        <version>2.5.2</version
    </plugin>
    <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>scala-compile-first</id>
                    <phase>process-resources</phase>
                    <!--suppress MavenModelInspection -->
                    <goals>
                        <goal>add-source</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
                <execution>
                    <id>scala-test-compile</id>
                    <phase>process-test-resources</phase>
                    <!--suppress MavenModelInspection -->
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
</plugins>
</build>
È stato utile?

Soluzione

It works. It was some kind of proxy issue, once I made build healthy again and built it several times, correct code-coverage appeared.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top