无法实现单模块设计中所有模块的声纳覆盖报告需要配置

问题描述

项目结构 在平台文件夹内

                    base-->parent pom.xml    (Project Abs path: E:\platform\base)
                    project1-->child pom.xml (Project Abs path: E:\platform\project1)
                    project2-->child pom.xml (Project Abs path: E:\platform\project2)
                    project3-->child pom.xml (Project Abs path: E:\platform\project3)
                    project4-->child pom.xml (Project Abs path: E:\platform\project4)

父 pom.xml

    <plugin.sonar-jacoco-listeners.version>3.8</plugin.sonar-jacoco-listeners.version>
    <plugin.jacoco-maven.version>0.8.2</plugin.jacoco-maven.version>

    <!-- Sonar -->
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.language>java</sonar.language>
    <plugin.sonar-maven.version>3.7.0.1746</plugin.sonar-maven.version>
    <plugin.maven-surefire.version>2.13</plugin.maven-surefire.version>



<!-- Profiles -->
<profiles>
    <profile>
        <id>coverage-per-test</id>
        <build>
            <plugins>
                <!-- Surefire Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${plugin.maven-surefire.version}</version>
                    <configuration>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>org.sonar.java.jacoco.JUnitListener</value>
                            </property>
                        </properties>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>org.sonarsource.java</groupId>
                <artifactId>sonar-jacoco-listeners</artifactId>
                <version>${plugin.sonar-jacoco-listeners.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

    <profile>
        <id>sonar-coverage</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${plugin.jacoco-maven.version}</version>
                    <executions>
                        <execution>
                            <id>agent-for-ut</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>agent-for-it</id>
                            <goals>
                                <goal>prepare-agent-integration</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-site</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Plugin to overide the Sonar Scaner version -->
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${plugin.sonar-maven.version}</version>
                </plugin>

            </plugins>
        </build>
    </profile>
</profiles>

project1、project2、project3、project4 子 pom.xml

        <!-- Surefire - Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${plugin.maven-surefire.version}</version>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>

        <!-- maven jacoco plugin -->
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
        </plugin>

        <!-- Sonar Scanner -->
        <plugin>
            <groupId>org.sonarsource.scanner.maven</groupId>
            <artifactId>sonar-maven-plugin</artifactId>
        </plugin>

以上是为父子 pom 所做的配置,我想在此结构中实现它,而无需创建聚合报告项目。使用现有的配置修改我想要解决方案

解决方法

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

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...