声纳,jacoco,和Maven不予配合我

问题描述 投票:1回答:1
  • Maven的3.0.4
  • 声纳Maven的插件2.2
  • jacoco - Maven的插件0.6.4.201312101107

当我运行mvn sonar:sonar的jacoco - Maven的插件的prepare-agent目标无法运行,所以在需要时代理参数是不是有万无一失。

当我明确运行mvn prepare-package sonar:sonar,我得到了jacoco初始化无限递归。

显然,我失去了一些东西,但什么?

 <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <!--
                  Prepares the property pointing to the JaCoCo runtime agent which
                  is passed as VM argument when Maven the Surefire plugin is executed.
              -->
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                          <propertyName>jaCoCoSurefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
maven-3 sonarqube jacoco
1个回答
0
投票

您必须配置足够的东西,使jacoco作品。检查配置:

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.6.2.201302030002</version>
  <executions>
    <!-- prepare agent for measuring unit tests -->
    <execution>
      <id>prepare-unit-tests</id>
      <goals>
        <goal>prepare-agent</goal>
      </goals>
      <configuration>
        <destFile>${sonar.jacoco.reportPath}</destFile>
      </configuration>
    </execution>
  </executions>
</plugin>

你也可以参考我的博客文章处理与单元测试和集成测试多模块项目:qazxsw POI

© www.soinside.com 2019 - 2024. All rights reserved.