jacoco prepare-agent不生成jacoco.exec文件

问题描述

不生成Exes文件。我的mvn sonar:sonar -Psonar-coverage个人资料 我也读了这个主题。没帮我 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>

在日志中:“由于缺少执行数据文件而跳过JaCoCo执行。 我的构建:

MVN全新安装-Psonar-coverage

但是,在日志中:

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

我怎么了?请帮助

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)