Open MEZk opened 7 years ago
Based on https://github.com/mojohaus/cobertura-maven-plugin/issues/21#issuecomment-281437726 and https://github.com/mojohaus/cobertura-maven-plugin/issues/18
Main.java
import java.util.stream.Stream; public class Main { public static void main(String[] args) { Stream.of("a", "b"); } }
MainTest.java
import org.junit.Test; public class MainTest { @Test public void testMain() { } }
pom.xml
<?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>test</groupId> <artifactId>test</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project>
CMD: mvn clean cobertura:cobertura Expected result: class Main is included into coverage report (0% coverage) Actual result: class Main is not included into coverage report (report is empty)
Seeing the same issue here. Preventing us from successfully migrating to newer version of Java language.
Based on https://github.com/mojohaus/cobertura-maven-plugin/issues/21#issuecomment-281437726 and https://github.com/mojohaus/cobertura-maven-plugin/issues/18
Main.java
MainTest.java
pom.xml
CMD: mvn clean cobertura:cobertura Expected result: class Main is included into coverage report (0% coverage) Actual result: class Main is not included into coverage report (report is empty)