jacoco-maven-plugin

Code Coverage Kotlin and Java together using Maven - Jacoco

二次信任 提交于 2020-05-27 03:14:29
问题 I am using Maven plugin to generate the code-coverage with Maven Plugin as below: <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>${jacoco.version}</version> <executions> <execution> <id>pre-unit-test</id> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>post-unit-test</id> <phase>test</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> But this does not include any code coverage of the kotlin

Jacoco doesn't produce coverage reports

守給你的承諾、 提交于 2020-05-16 05:04:10
问题 I 'm using maven-sure fire plugin to execute tests and Jacoco plugin to generate the coverage reports. Jacoco does't provide coverage reports and instead fails with the debug log as shown here under. [INFO] --- jacoco-maven-plugin:0.8.0:report (jacoco-site) @ util --- [INFO] Skipping JaCoCo execution due to missing execution data file. Here is how the maven sure-fire plugin looks. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.5.2

Display Sonar Code Coverage with jacoco.exec file in Sonar LTS 7.9.2

感情迁移 提交于 2020-05-15 19:11:48
问题 Recently I have updated SonarQube 7.9.2 in which sonar.jacoco.reportPaths property has been deprecated and need to use sonar.coverage.jacoco.xmlReportPaths . I don't have JaCoCo xml report generated and I am using ant for build and JUnit. Please help me to view the coverage on SonarQube with exec file. 来源: https://stackoverflow.com/questions/59527088/display-sonar-code-coverage-with-jacoco-exec-file-in-sonar-lts-7-9-2

Merging sonar metrics across a maven multi-module project

送分小仙女□ 提交于 2020-01-25 12:40:09
问题 I've inherited an odd maven multi module project. The standard business classes and unit tests are in a module called 'code' and we've nice simple working sonar metrics for this module. The second module holds various integration style tests which run against a deployed glassfish server, these run as unit test in the integ-test module. pom.xml // root level, code // business code and unit tests :-) moduleA moduleB integ-test // ;-( moduleA moduleB I know the simplest option is to move the

JaCoCo (Offline Instrumentation) in <goal>instrument</goal> analyzes the entire pom.xml. But I need only the tests part

你。 提交于 2020-01-15 03:54:12
问题 Basically I need jacoco only instrument the tests part, but is instrumententing the entire pom.xml, and the report came with everything (Data from “oracle.jdbc.driver”, “com.mysql.jdbc”… etc.) I've been trying for a couple of days with almost everything. But I have not succeeded so far Notice here how jacoco:instrument instrument the entire pom.xml [INFO] --- jacoco-maven-plugin:0.8.4:instrument (default-instrument) @ myApp --- ... [DEBUG] (f) project = MavenProject: com.firstPackage.tdz

How to specify the specific packages for the 'jacoco-check'?

落爺英雄遲暮 提交于 2020-01-03 02:45:08
问题 My project is built using Maven. I use the 'Jacoco' plugin to perform quality checks. For a project I would like to check the test coverage on line basis. I would like to check the line coverage only for only 3 packages. How can I specify this check? I tried 'including' a number of packages, but that does not work. I also tried to include the root package level and exclude a number of other packages. Also not working. How can I have the package A, B and C checked? See my example below:

Have integration tests in jacoco-it directory

隐身守侯 提交于 2019-12-25 17:21:31
问题 I have integration tests and they are executed fine, but Jacoco considers them as unit tests. How to tell Jacoco to see them as integration tests and display their graph coverage, not in the jacoco-ut directory, but it the jacoco-it directory ? Here in the Maven configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <configuration> <argLine>${surefireArgLine}</argLine> <excludes> <exclude>**/it/java/*.java<

how do I make jacoco add the tests files themselves to the coverage report

时间秒杀一切 提交于 2019-12-24 19:07:37
问题 In my sample maven project, I have this jacoco configuration: <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.4</version> <executions> <execution> <id>jacoco-initialize</id> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>jacoco-report</id> <phase>test</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> which I got from https://automationrhapsody.com/automated-code-coverage-of-unit-tests

How to get JaCoCo instrumentation code coverage while executing webApplication on server

[亡魂溺海] 提交于 2019-12-23 05:06:30
问题 I want to get a code coverage report (or tracking controller flow of an application) when I execute the some scenario on live application i.e. while application running in server, so I have refereed the official Jacoco documentation and did as fallows As a first step, I tried to bind the jacoco agent to the application running port export MAVEN_OPTS=-javaagent:/home/user/.m2/repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=includes=*

How to add more Jacoco exclusions in a child project?

你说的曾经没有我的故事 提交于 2019-12-22 12:20:02
问题 In a parent POM we have Jacoco rules set up to enforce test coverage. This includes some exclusions for classes that typically don't have behavior: <execution> <id>default-check</id> <goals> <goal>check</goal> </goals> <configuration> <excludes> <!-- exclude largely auto-generated domain and model classes --> <exclude>**/model/*.class</exclude> <exclude>**/model/**/*.class</exclude> <exclude>**/domain/*.class</exclude> <exclude>**/domain/**/*.class</exclude> <exclude>**/dto/*.class</exclude>