Jacoco coverage is showing zero line coverage for a specific java package.
I am using apache beam java SDK along with JDK.
attaching the pom.xml and also jacoco.xml report for your reference.

I am using sonarqube for code coverage. Since jacoco coverage is not 
properly working so sonarqube is showing 0 line coverage for this specific 
package.

Let me know any inputs or suggestion. I have tried multiple ways but 
nothing worked.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/3e920b15-1429-4f21-9118-0ce4e9afd342n%40googlegroups.com.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN" "report.dtd"><report name="pipeline"><sessioninfo id="ITINKOI-DW0342-7868cb8b" start="1612443222770" dump="1612443254225"/><package name="com/ikea/gcp/dataflow/dpfw/pipeline"><class name="com/ikea/gcp/dataflow/dpfw/pipeline/IngestionPipeline" sourcefilename="IngestionPipeline.java"><method name="&lt;init&gt;" desc="()V" line="23"><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="main" desc="([Ljava/lang/String;)V" line="35"><counter type="INSTRUCTION" missed="178" covered="0"/><counter type="BRANCH" missed="2" covered="0"/><counter type="LINE" missed="37" covered="0"/><counter type="COMPLEXITY" missed="2" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="getPipelineConfiguration" desc="(Lcom/ikea/gcp/dataflow/dpfw/config/options/IngestionOptions;)Lcom/ikea/gcp/dataflow/dpfw/config/PipelineConfiguration;" line="94"><counter type="INSTRUCTION" missed="137" covered="0"/><counter type="BRANCH" missed="2" covered="0"/><counter type="LINE" missed="20" covered="0"/><counter type="COMPLEXITY" missed="2" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="&lt;clinit&gt;" desc="()V" line="31"><counter type="INSTRUCTION" missed="4" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><counter type="INSTRUCTION" missed="322" covered="0"/><counter type="BRANCH" missed="4" covered="0"/><counter type="LINE" missed="59" covered="0"/><counter type="COMPLEXITY" missed="6" covered="0"/><counter type="METHOD" missed="4" covered="0"/><counter type="CLASS" missed="1" covered="0"/></class><sourcefile name="IngestionPipeline.java"><line nr="23" mi="3" ci="0" mb="0" cb="0"/><line nr="31" mi="4" ci="0" mb="0" cb="0"/><line nr="35" mi="7" ci="0" mb="0" cb="0"/><line nr="37" mi="3" ci="0" mb="0" cb="0"/><line nr="39" mi="3" ci="0" mb="0" cb="0"/><line nr="41" mi="3" ci="0" mb="0" cb="0"/><line nr="43" mi="6" ci="0" mb="0" cb="0"/><line nr="44" mi="6" ci="0" mb="0" cb="0"/><line nr="45" mi="6" ci="0" mb="0" cb="0"/><line nr="46" mi="6" ci="0" mb="0" cb="0"/><line nr="48" mi="6" ci="0" mb="0" cb="0"/><line nr="50" mi="3" ci="0" mb="0" cb="0"/><line nr="51" mi="3" ci="0" mb="0" cb="0"/><line nr="52" mi="6" ci="0" mb="0" cb="0"/><line nr="53" mi="6" ci="0" mb="0" cb="0"/><line nr="54" mi="15" ci="0" mb="0" cb="0"/><line nr="56" mi="10" ci="0" mb="0" cb="0"/><line nr="57" mi="10" ci="0" mb="0" cb="0"/><line nr="61" mi="7" ci="0" mb="0" cb="0"/><line nr="62" mi="13" ci="0" mb="0" cb="0"/><line nr="65" mi="2" ci="0" mb="2" cb="0"/><line nr="66" mi="2" ci="0" mb="0" cb="0"/><line nr="67" mi="10" ci="0" mb="0" cb="0"/><line nr="69" mi="2" ci="0" mb="0" cb="0"/><line nr="70" mi="9" ci="0" mb="0" cb="0"/><line nr="74" mi="5" ci="0" mb="0" cb="0"/><line nr="75" mi="3" ci="0" mb="0" cb="0"/><line nr="76" mi="2" ci="0" mb="0" cb="0"/><line nr="77" mi="2" ci="0" mb="0" cb="0"/><line nr="78" mi="1" ci="0" mb="0" cb="0"/><line nr="80" mi="4" ci="0" mb="0" cb="0"/><line nr="81" mi="3" ci="0" mb="0" cb="0"/><line nr="82" mi="3" ci="0" mb="0" cb="0"/><line nr="83" mi="2" ci="0" mb="0" cb="0"/><line nr="84" mi="2" ci="0" mb="0" cb="0"/><line nr="85" mi="2" ci="0" mb="0" cb="0"/><line nr="86" mi="1" ci="0" mb="0" cb="0"/><line nr="88" mi="3" ci="0" mb="0" cb="0"/><line nr="90" mi="1" ci="0" mb="0" cb="0"/><line nr="94" mi="4" ci="0" mb="0" cb="0"/><line nr="96" mi="4" ci="0" mb="2" cb="0"/><line nr="97" mi="7" ci="0" mb="0" cb="0"/><line nr="98" mi="6" ci="0" mb="0" cb="0"/><line nr="99" mi="1" ci="0" mb="0" cb="0"/><line nr="100" mi="7" ci="0" mb="0" cb="0"/><line nr="101" mi="6" ci="0" mb="0" cb="0"/><line nr="104" mi="16" ci="0" mb="0" cb="0"/><line nr="105" mi="16" ci="0" mb="0" cb="0"/><line nr="106" mi="9" ci="0" mb="0" cb="0"/><line nr="107" mi="6" ci="0" mb="0" cb="0"/><line nr="110" mi="7" ci="0" mb="0" cb="0"/><line nr="111" mi="9" ci="0" mb="0" cb="0"/><line nr="112" mi="3" ci="0" mb="0" cb="0"/><line nr="113" mi="7" ci="0" mb="0" cb="0"/><line nr="114" mi="7" ci="0" mb="0" cb="0"/><line nr="115" mi="6" ci="0" mb="0" cb="0"/><line nr="118" mi="8" ci="0" mb="0" cb="0"/><line nr="119" mi="6" ci="0" mb="0" cb="0"/><line nr="122" mi="2" ci="0" mb="0" cb="0"/><counter type="INSTRUCTION" missed="322" covered="0"/><counter type="BRANCH" missed="4" covered="0"/><counter type="LINE" missed="59" covered="0"/><counter type="COMPLEXITY" missed="6" covered="0"/><counter type="METHOD" missed="4" covered="0"/><counter type="CLASS" missed="1" covered="0"/></sourcefile><counter type="INSTRUCTION" missed="322" covered="0"/><counter type="BRANCH" missed="4" covered="0"/><counter type="LINE" missed="59" covered="0"/><counter type="COMPLEXITY" missed="6" covered="0"/><counter type="METHOD" missed="4" covered="0"/><counter type="CLASS" missed="1" covered="0"/></package><package name="com/ikea/gcp/dataflow/dpfw/utils"><class name="com/ikea/gcp/dataflow/dpfw/utils/Constants" sourcefilename="Constants.java"><method name="&lt;init&gt;" desc="()V" line="3"><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/><counter type="CLASS" missed="1" covered="0"/></class><sourcefile name="Constants.java"><line nr="3" mi="3" ci="0" mb="0" cb="0"/><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/><counter type="CLASS" missed="1" covered="0"/></sourcefile><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/><counter type="CLASS" missed="1" covered="0"/></package><counter type="INSTRUCTION" missed="325" covered="0"/><counter type="BRANCH" missed="4" covered="0"/><counter type="LINE" missed="60" covered="0"/><counter type="COMPLEXITY" missed="7" covered="0"/><counter type="METHOD" missed="5" covered="0"/><counter type="CLASS" missed="2" covered="0"/></report>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
	license agreements. See the NOTICE file distributed with this work for additional 
	information regarding copyright ownership. The ASF licenses this file to 
	You under the Apache License, Version 2.0 (the "License"); you may not use 
	this file except in compliance with the License. You may obtain a copy of 
	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
	by applicable law or agreed to in writing, software distributed under the 
	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
	OF ANY KIND, either express or implied. See the License for the specific 
	language governing permissions and limitations under the License. -->
<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>com.ikea.gcp.dataflow</groupId>
	<artifactId>pipeline-framework</artifactId>
	<version>0.1</version>
	<packaging>pom</packaging>

	<modules>
		<module>configuration</module>
		<module>transform</module>
		<module>pipeline</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<beam.version>2.21.0</beam.version>
		<!-- <beam.version>2.18.0</beam.version> -->

		<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
		<maven-exec-plugin.version>1.6.0</maven-exec-plugin.version>
		<maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
		<slf4j.version>1.7.25</slf4j.version>

		<autovalue.annotations.version>1.6</autovalue.annotations.version>
		<autovalue.version>1.6.2</autovalue.version>

		<sonar-maven-plugin.version>3.6.0.1398</sonar-maven-plugin.version>
		<jacoco.version>0.8.5</jacoco.version>
	</properties>

	<repositories>
		<repository>
			<id>apache.snapshots</id>
			<name>Apache Development Snapshot Repository</name>
			<url>https://repository.apache.org/content/repositories/snapshots/</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>configuration</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>transform</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>pipeline</artifactId>
				<version>${project.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<id>pre-unit-test</id>
						<phase>process-test-classes</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<outputDirectory>target/jacoco-report</outputDirectory>
							<!-- <excludes>
								<exclude>${jacoco.exclusions}</exclude>
							</excludes> -->
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.1</version>
				<configuration>
					<useSystemClassLoader>false</useSystemClassLoader>
				</configuration>
			</plugin>
			<!-- <plugin> -->
			<!-- <artifactId>maven-assembly-plugin</artifactId> -->
			<!-- <version>2.6</version> -->
			<!-- <configuration> -->
			<!-- <archive> -->
			<!-- <manifest> -->
			<!-- <mainClass>com.ikea.gcp.dataflow.dpfw.pipeline.StarterPipeline</mainClass> -->
			<!-- </manifest> -->
			<!-- </archive> -->
			<!-- <descriptorRefs> -->
			<!-- <descriptorRef>jar-with-dependencies</descriptorRef> -->
			<!-- </descriptorRefs> -->
			<!-- </configuration> -->
			<!-- <executions> -->
			<!-- <execution> -->
			<!-- <id>make-assembly</id> &lt;!&ndash; this is used for inheritance 
				merges &ndash;&gt; -->
			<!-- <phase>package</phase> &lt;!&ndash; bind to the packaging phase &ndash;&gt; -->
			<!-- <goals> -->
			<!-- <goal>single</goal> -->
			<!-- </goals> -->
			<!-- </execution> -->
			<!-- </executions> -->
			<!-- </plugin> -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${maven-jar-plugin.version}</version>
				<configuration>
					<finalName>${project.artifactId}-bundled-${project.version}</finalName>
					<archive>
						<manifest>
							<!-- <addClasspath>true</addClasspath> -->
							<!-- <classpathPrefix>lib/</classpathPrefix> -->
							<mainClass>com.ikea.gcp.dataflow.dpfw.pipeline.IngestionPipeline</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> 
				<version>3.0.0</version> <executions> <execution> <id>bundle-and-repackage</id> 
				<phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> 
				<artifactSet> <includes> <include>*:*</include> </includes> </artifactSet> 
				<transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" 
				/> </transformers> </configuration> </execution> </executions> </plugin> -->

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>bundle-and-repackage</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/*.SF</exclude>
									</excludes>
								</filter>
							</filters>
							<transformers>
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
							</transformers>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.sonarsource.scanner.maven</groupId>
				<artifactId>sonar-maven-plugin</artifactId>
				<version>${sonar-maven-plugin.version}</version>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>${maven-exec-plugin.version}</version>
					<configuration>
						<skip>true</skip>
						<executable>java</executable>
						<cleanupDaemonThreads>false</cleanupDaemonThreads>
					</configuration>
				</plugin>


			</plugins>


		</pluginManagement>
	</build>

	<dependencies>
		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-storage</artifactId>
			<version>1.101.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-runners-direct-java</artifactId>
			<version>${beam.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.api</groupId>
			<artifactId>gax-grpc</artifactId>
			<version>1.55.0</version>
			<!-- <version>1.49.0</version> -->
		</dependency>
		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-kms</artifactId>
			<version>1.34.0</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.cloud</groupId>
					<artifactId>google-cloud-core-grpc</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-datastore</artifactId>
			<version>1.102.3</version>
		</dependency>

		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-sdks-java-core</artifactId>
			<version>${beam.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
			<version>${beam.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>junit</artifactId>
					<groupId>junit</groupId>
				</exclusion>
				<exclusion>
					<groupId>com.google.api</groupId>
					<artifactId>gax-grpc</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.grpc</groupId>
					<artifactId>grpc-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-sdks-java-extensions-google-cloud-platform-core</artifactId>
			<version>${beam.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.api</groupId>
					<artifactId>gax-grpc</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-sdks-java-io-jdbc</artifactId>
			<version>${beam.version}</version>
		</dependency>


		<dependency>
			<groupId>org.apache.beam</groupId>
			<artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
			<version>${beam.version}</version>
		</dependency>

		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20190722</version>
		</dependency>

		<!-- Thanks for using https://jar-download.com -->


		<!-- By default, the starter project has a dependency on the Beam DirectRunner 
			to enable development and testing of pipelines. To run on another of the 
			Beam runners, add its module to this pom.xml according to the runner-specific 
			setup instructions on the Beam website: http://beam.apache.org/documentation/#runners -->
		<!-- <dependency> -->
		<!-- <groupId>org.apache.beam</groupId> -->
		<!-- <artifactId>beam-runners-direct-java</artifactId> -->
		<!-- <version>${beam.version}</version> -->
		<!-- <scope>runtime</scope> -->
		<!-- </dependency> -->

		<!-- slf4j API frontend binding with JUL backend -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
			<version>${slf4j.version}</version>
		</dependency>


		<dependency>
			<groupId>com.google.auto.value</groupId>
			<artifactId>auto-value</artifactId>
			<version>${autovalue.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.auto.value</groupId>
			<artifactId>auto-value-annotations</artifactId>
			<version>${autovalue.annotations.version}</version>
		</dependency>

		<dependency>
			<groupId>com.google.cloud.sql</groupId>
			<artifactId>postgres-socket-factory</artifactId>
			<version>1.0.13</version>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>42.2.5</version>
		</dependency>
		<dependency>
			<groupId>com.zaxxer</groupId>
			<artifactId>HikariCP</artifactId>
			<version>2.6.1</version>
		</dependency>

		<dependency>
			<groupId>org.apache.avro</groupId>
			<artifactId>avro</artifactId>
			<version>1.9.0</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.opencensus</groupId>
			<artifactId>opencensus-api</artifactId>
			<version>0.25.0</version>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-all</artifactId>
			<version>1.3</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.jcraft</groupId>
			<artifactId>jsch</artifactId>
			<version>0.1.55</version>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>29.0-jre</version>
		</dependency>

		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-logging</artifactId>
			<version>1.101.2</version>
		</dependency>


	</dependencies>
</project>

Reply via email to