0

Exes files are not generated. My profile for mvn sonar:sonar -Psonar-coverage I also read this thread. didn't help me jacoco's prepare-agent not generating jacoco.exec file

 <profile>
      <id>sonar-coverage</id>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://nexus-url.ru/nexus/content/repositories/central/</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${jacoco.version}</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <destFile>${basedir}/target/coverage-reports/jacoco-ut.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <dataFile>${basedir}/target/coverage-reports/jacoco-ut.exec</dataFile>
                  <outputDirectory>${basedir}/target/jacoco-ut-report</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>pre-integration-test</id>
                <phase>package</phase>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <destFile>${basedir}/target/coverage-reports/jacoco-it.exec</destFile>
                  <propertyName>integrationTestArgLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>post-integration-test</id>
                <phase>verify</phase>
                <goals>
                  <goal>report-integration</goal>
                </goals>
                <configuration>
                  <dataFile>${basedir}/target/coverage-reports/jacoco-it.exec</dataFile>
                  <outputDirectory>${basedir}/target/jacoco-it-report</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

In logs: "Skipping JaCoCo execution due to missing execution data file." My build:

mvn clean install -Psonar-coverage

but, in logs:

 [INFO] --- jacoco-maven-plugin:0.8.0:prepare-agent (pre-unit-test) @ pos-parent ---
 [INFO] argLine set to -javaagent:/pos/.m2/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/pos/pos/target/coverage-reports/jacoco-ut.exec
 [INFO] 
 [INFO] <<< maven-source-plugin:2.1.2:jar (attach-sources) < generate-sources @ pos-parent <<<
 [INFO] 
 [INFO] 
 [INFO] --- maven-source-plugin:2.1.2:jar (attach-sources) @ pos-parent ---
 [INFO] 
 [INFO] --- jacoco-maven-plugin:0.8.0:prepare-agent-integration (pre-integration-test) @ pos-parent ---
 [INFO] integrationTestArgLine set to -javaagent:/pos/.m2/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/pos/pos/target/coverage-reports/jacoco-it.exec
 [INFO] 
 [INFO] --- maven-scm-validator-plugin:1.0.2:validate (default) @ pos-parent ---
 [WARNING] Project's dir probably isn't local copy of SVN repository. SCM settings validation will be skipped.
 [INFO] 
 [INFO] --- maven-dependency-conflicts-plugin:1.0:analyze (default) @ pos-parent ---
 [INFO] 
 [INFO] --- jacoco-maven-plugin:0.8.0:report-integration (post-integration-test) @ pos-parent ---
 [INFO] Skipping JaCoCo execution due to missing execution data file.

what's my mistake? please help

dobre
  • 15
  • 5
  • I think this looks same issue as: https://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec – Ananth Oct 23 '20 at 09:14
  • Does it work if you keep the default path to the jacoco exec file? – isnot2bad Oct 23 '20 at 09:16
  • ${argLine} -Xmx256m dont help – dobre Oct 23 '20 at 09:43
  • in your log between `prepapre-agent` and `report` there is no execution of tests - there is nothing like `maven-surefire-plugin` execution, which is usually responsible for the execution of tests ;) – Godin Oct 23 '20 at 15:43

0 Answers0