4

저는 새로운 Cobertura입니다. 테스트 케이스를 작성했으며 람다 식을 코딩에 사용하고 있으며 오류를 해결하는 방법을 제공합니다. 이 문제.cobertura는 Java 8을 지원합니까? java8 labmda 표현식을 사용하고 싶기 때문에 오류가 발생합니다.

Google에서 검색하여 Jacoco가 Java8을 지원한다는 사실을 알게되었습니다.

하지만 Cobertura 플러그인으로 jacoco 플러그인을 삽입하는 방법을 모르겠다. 내 봄 부팅 프로젝트의 pom.xml에서

Cobertura 플러그인은 다음과 같다 :

<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> 

감사합니다.

답변

0

Like Cobertura - JaCoCo는 Maven 플러그인을 제공합니다. 그 설명과 예는 JaCoCo documentation에서 찾을 수 있습니다.

관련 문제