0

我的项目总共有 50 个模块和 10 个配置文件。5 个配置文件用于构建 5 个产品,5 个配置文件用于对相同的 5 个产品进行单元测试。

30 个通用模块和 4 个模块用于构建每个产品的每个配置文件。现在我必须看看如何将 SONAR 分析与每个产品的 Jenkins 工作相结合。

我需要在声纳中看到 5 个条目,每个产品一个,但我有一个 pom 文件。这可以实现吗。

请帮忙。下面的示例 pom 文件

<modules>
        <!-- Script related projects -->
        <!-- Common modules -->
        <module>./././bundles/com.abc.module1</module>
        <module>./././bundles/com.abc.module2</module>
            .
            .
        <module>./././bundles/com.abc.module30</module>
</modules>

<profiles>
        <profile>
            <id>product1</id>
            <modules>
                <module>./././bundles/com.abc.module31</module>
                <module>./././bundles/com.abc.module32</module>
            </modules>
        </profile>

        <profile>
            <id>product1-tests</id>
            <modules>
                <module>./././bundles/com.abc.testmodule1</module>
                <module>./././bundles/com.abc.testmodule2</module>
            </modules>
        </profile>
        .
        .
        .

</profiles>
4

2 回答 2

0

如果您现在没有,我只需创建一个包含所有源模块的配置文件,并有一个运行声纳的 jenkins 作业来构建和分析该单个配置文件。Sonar 将为您的源提供质量指标和覆盖范围,因此您只需要一个包含所有源的声纳项目。此配置文件应包括您的测试,但仅用于在测试运行时收集覆盖率数据 - 您不需要对测试进行质量测量(除非您对这类事情感兴趣)。

于 2015-08-06T16:29:09.073 回答
0

Sonar 基于“artifactId”标签构建项目。因为对于一个 pom 文件,我们只有 1 个“artifactId”,所以我们只能在 sonarqube 中列出 1 个项目。我们必须为多个声纳项目条目提供多个 pom 文件。谢谢你。

于 2015-08-13T07:10:14.500 回答