0

我有一个类似这样的目录结构:

  • 根据
    • 子目录1
    • 子目录2
    • 子目录3
      • 子目录1
      • 子目录2
    • 子目录4
    • 单元测试

如何设置我的 pom.xml 以便它只处理粗体文件夹?如果可能的话,我希望它们都在一次mvn sonar:sonar调用中得到处理,并在 Sonar 中显示为单独的项目。我尝试查看项目对象模型的文档,但我发现它过于庞大,并且无法弄清楚如何按照我的描述进行设置。这就是我位于 base 中的 pom.xml 目前的样子:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.foo.bar.baz</groupId>
        <artifactId>subsubdir2</artifactId>
        <name>MyProject</name>
        <version>1.0</version>

        <build>
                <sourceDirectory>subdir3/subsubdir2</sourceDirectory>
                <testSourceDirectory>unittests</testSourceDirectory>
        </build>

        <properties>
                <sonar.language>php</sonar.language>
                <sonar.phase>generate-sources</sonar.phase>
        </properties>
</project>
4

1 回答 1

0

您可以构建顶级 pom 并使用sonar.skippedModules 或 sonar.includedModules 属性来设置要构建的模块列表。这不会将每个模块显示为声纳顶层的单独项目,但如果您进入项目并选择“模块”,那么您会看到每个模块都列出,就好像它是一个单独的项目一样。

于 2011-07-18T19:01:04.860 回答