I have a Java 7 project I am trying to port to Java 8.
      Everything else is working fine except maven tests, which result in zero coverage when project source/target is 1.8. Upon inspecting the resulting jacoco.exec it appears to be intact and showing executed classes properly.

      I don't see any jacoco related errors in the build log and build is successful with both java versions.

      I'm using jenkins 1.560, jacoco-maven-plugin 0.7.0.201403182114, jenkins jacoco plugin 1.0.14.

      I don't know if this is an issue with jacoco-maven-plugin or if it's actually a problem with maven-compiler-plugin or aspectj-maven-plugin.
      The only differences between Java 7 and 8 in my pom.xml are related to maven-compiler-plugin and aspectj-maven-plugin:

      <properties>
      		<jdk.version>1.7</jdk.version>
      </properties>
      
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-compiler-plugin</artifactId>
      				<configuration>
      					<source>${jdk.version}</source>
      					<target>${jdk.version}</target>
      					<showDeprecation>false</showDeprecation>
      				</configuration>
      			</plugin>
      
      <groupId>org.codehaus.mojo</groupId>
      					<artifactId>aspectj-maven-plugin</artifactId>
      					<version>1.6</version>
      					<configuration>
      						<showWeaveInfo>true</showWeaveInfo>
      						<source>${jdk.version}</source>
      						<target>${jdk.version}</target>
      						<Xlint>ignore</Xlint>
      						<complianceLevel>${jdk.version}</complianceLevel>
      
      

          [JENKINS-22716] Jacoco: Zero coverage with java8

          Risto Oikarinen created issue -
          Risto Oikarinen made changes -
          Description Original: I have a Java 7 project I am trying to port to Java 8.
          Everything else is working fine except maven tests, which result in zero coverage when project source/target is 1.8. Upon inspecting the resulting jacoco.exec it appears to be intact and showing executed classes properly.

          I don't know if this is an issue with jacoco-maven-plugin or if it's actually a problem with maven-compiler-plugin or aspectj-maven-plugin.
          The only differences between Java 7 and 8 in my pom.xml are related to maven-compiler-plugin and aspectj-maven-plugin:

          {code}
          <properties>
          <jdk.version>1.7</jdk.version>
          </properties>
          {code}

          {code}
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <showDeprecation>false</showDeprecation>
          </configuration>
          </plugin>
          {code}

          {code}
          groupId>org.codehaus.mojo</groupId>
          <artifactId>aspectj-maven-plugin</artifactId>
          <version>1.6</version>
          <configuration>
          <showWeaveInfo>true</showWeaveInfo>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <Xlint>ignore</Xlint>
          <complianceLevel>${jdk.version}</complianceLevel>

          {code}
          New: I have a Java 7 project I am trying to port to Java 8.
          Everything else is working fine except maven tests, which result in zero coverage when project source/target is 1.8. Upon inspecting the resulting jacoco.exec it appears to be intact and showing executed classes properly.

          I don't see any jacoco related errors in the build log and build is successful with both java versions.

          I'm using jenkins 1.560, jacoco-maven-plugin 0.7.0.201403182114, jenkins jacoco plugin 1.0.14.

          I don't know if this is an issue with jacoco-maven-plugin or if it's actually a problem with maven-compiler-plugin or aspectj-maven-plugin.
          The only differences between Java 7 and 8 in my pom.xml are related to maven-compiler-plugin and aspectj-maven-plugin:

          {code}
          <properties>
          <jdk.version>1.7</jdk.version>
          </properties>
          {code}

          {code}
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <showDeprecation>false</showDeprecation>
          </configuration>
          </plugin>
          {code}

          {code}
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>aspectj-maven-plugin</artifactId>
          <version>1.6</version>
          <configuration>
          <showWeaveInfo>true</showWeaveInfo>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <Xlint>ignore</Xlint>
          <complianceLevel>${jdk.version}</complianceLevel>

          {code}
          Risto Oikarinen made changes -
          Description Original: I have a Java 7 project I am trying to port to Java 8.
          Everything else is working fine except maven tests, which result in zero coverage when project source/target is 1.8. Upon inspecting the resulting jacoco.exec it appears to be intact and showing executed classes properly.

          I don't see any jacoco related errors in the build log and build is successful with both java versions.

          I'm using jenkins 1.560, jacoco-maven-plugin 0.7.0.201403182114, jenkins jacoco plugin 1.0.14.

          I don't know if this is an issue with jacoco-maven-plugin or if it's actually a problem with maven-compiler-plugin or aspectj-maven-plugin.
          The only differences between Java 7 and 8 in my pom.xml are related to maven-compiler-plugin and aspectj-maven-plugin:

          {code}
          <properties>
          <jdk.version>1.7</jdk.version>
          </properties>
          {code}

          {code}
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <showDeprecation>false</showDeprecation>
          </configuration>
          </plugin>
          {code}

          {code}
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>aspectj-maven-plugin</artifactId>
          <version>1.6</version>
          <configuration>
          <showWeaveInfo>true</showWeaveInfo>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <Xlint>ignore</Xlint>
          <complianceLevel>${jdk.version}</complianceLevel>

          {code}
          New: I have a Java 7 project I am trying to port to Java 8.
          Everything else is working fine except maven tests, which result in zero coverage when project source/target is 1.8. Upon inspecting the resulting jacoco.exec it appears to be intact and showing executed classes properly.

          I don't see any jacoco related errors in the build log and build is successful with both java versions.

          I'm using jenkins 1.560, jacoco-maven-plugin 0.7.0.201403182114, jenkins jacoco plugin 1.0.14.

          I don't know if this is an issue with jacoco-maven-plugin or if it's actually a problem with maven-compiler-plugin or aspectj-maven-plugin.
          The only differences between Java 7 and 8 in my pom.xml are related to maven-compiler-plugin and aspectj-maven-plugin:


          {code}
          <properties>
          <jdk.version>1.7</jdk.version>
          </properties>
          {code}

          {code}
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <showDeprecation>false</showDeprecation>
          </configuration>
          </plugin>
          {code}

          {code}
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>aspectj-maven-plugin</artifactId>
          <version>1.6</version>
          <configuration>
          <showWeaveInfo>true</showWeaveInfo>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <Xlint>ignore</Xlint>
          <complianceLevel>${jdk.version}</complianceLevel>

          {code}

          Tamas Kende added a comment -

          same issue with: jacoco-maven-plugin 0.7.0.201403182114, jenkins: 1.528, jenkins-jacoco: 1.0.14, I use no aspectJ, and the report can be successfully generated with the maven-jacoco plugin.

          Tamas Kende added a comment - same issue with: jacoco-maven-plugin 0.7.0.201403182114, jenkins: 1.528, jenkins-jacoco: 1.0.14, I use no aspectJ, and the report can be successfully generated with the maven-jacoco plugin.
          Chris lutje Spelberg made changes -
          Labels New: java8

          WORKAROUND
          Compile using JDK 7 source and target:

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
          </plugin>
          

          Chris lutje Spelberg added a comment - WORKAROUND Compile using JDK 7 source and target: <plugin> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-compiler-plugin </artifactId> <version> 3.1 </version> <configuration> <source> 1.7 </source> <target> 1.7 </target> </configuration> </plugin>

          Using 1.7 as source/target in maven-compiler-plugin results in "maven update" flipping project compiler & facets to 1.7 as well (Eclipse only). Not very nice if you have 1.8 dependencies...

          Risto Oikarinen added a comment - Using 1.7 as source/target in maven-compiler-plugin results in "maven update" flipping project compiler & facets to 1.7 as well (Eclipse only). Not very nice if you have 1.8 dependencies...

          Tamas Kende added a comment - - edited

          I have a java8 project, so I cannot compile with 1.7... any idea where can be the issue? the maven-jacoco:report works fine.

          Tamas Kende added a comment - - edited I have a java8 project, so I cannot compile with 1.7... any idea where can be the issue? the maven-jacoco:report works fine.

          I have the same problem with gradle jacocoTestReport (sourceCompatibility 1.8 targetCompatibility 1.8), the html reports are great

          peterkittreilly added a comment - I have the same problem with gradle jacocoTestReport (sourceCompatibility 1.8 targetCompatibility 1.8), the html reports are great

          I'm seeing the same issue with 1.8. The html reports work just fine, and the jacoco.exec looks to be okay, but it's not showing any coverage (where it was working fine before). I'm using sbt and jacoco4sbt to generate the exec file.

          Austin Pernell added a comment - I'm seeing the same issue with 1.8. The html reports work just fine, and the jacoco.exec looks to be okay, but it's not showing any coverage (where it was working fine before). I'm using sbt and jacoco4sbt to generate the exec file.

            centic centic
            risto_oikarinen Risto Oikarinen
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: