Does cobertura support java 8? Because I want to use the java8 labmda expression and this gives me an error

I am the new Cobertura. I wrote a test case and I use the Lambda expression in coding and it gives me an error on how to solve this problem.

I search on google and find out that Jacoco supports Java8.

But how to insert jacoco plugin as Cobertura plugin which I don't get.

The Cobertura plugin in my spring pom.xml boot project looks like this:

<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <!-- <check> <branchRate>85</branchRate> <lineRate>85</lineRate> <haltOnFailure>true</haltOnFailure> 
                        <totalBranchRate>85</totalBranchRate> <totalLineRate>85</totalLineRate> <packageLineRate>85</packageLineRate> 
                        <packageBranchRate>85</packageBranchRate> </check> -->
                    <formats>
                        <format>xml</format>
                    </formats>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>cobertura</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

Thank.

+4
source share
1 answer

Cobertura - JaCoCo Maven. , JaCoCo.

<build>
  <plugins>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <version>0.8.4</version>
      <executions>
        <execution>
          <goals>
            <goal>prepare-agent</goal>
            <goal>report</goal>
          </goals>
        </execution>
0

Source: https://habr.com/ru/post/1662533/


All Articles