<legend id='PwQyi'><style id='PwQyi'><dir id='PwQyi'><q id='PwQyi'></q></dir></style></legend>
    1. <tfoot id='PwQyi'></tfoot>
    2. <i id='PwQyi'><tr id='PwQyi'><dt id='PwQyi'><q id='PwQyi'><span id='PwQyi'><b id='PwQyi'><form id='PwQyi'><ins id='PwQyi'></ins><ul id='PwQyi'></ul><sub id='PwQyi'></sub></form><legend id='PwQyi'></legend><bdo id='PwQyi'><pre id='PwQyi'><center id='PwQyi'></center></pre></bdo></b><th id='PwQyi'></th></span></q></dt></tr></i><div id='PwQyi'><tfoot id='PwQyi'></tfoot><dl id='PwQyi'><fieldset id='PwQyi'></fieldset></dl></div>
        <bdo id='PwQyi'></bdo><ul id='PwQyi'></ul>
    3. <small id='PwQyi'></small><noframes id='PwQyi'>

        Maven SonarQube 多模块

        时间:2024-05-09
        1. <legend id='wAk7w'><style id='wAk7w'><dir id='wAk7w'><q id='wAk7w'></q></dir></style></legend>

          <small id='wAk7w'></small><noframes id='wAk7w'>

            <bdo id='wAk7w'></bdo><ul id='wAk7w'></ul>

                <i id='wAk7w'><tr id='wAk7w'><dt id='wAk7w'><q id='wAk7w'><span id='wAk7w'><b id='wAk7w'><form id='wAk7w'><ins id='wAk7w'></ins><ul id='wAk7w'></ul><sub id='wAk7w'></sub></form><legend id='wAk7w'></legend><bdo id='wAk7w'><pre id='wAk7w'><center id='wAk7w'></center></pre></bdo></b><th id='wAk7w'></th></span></q></dt></tr></i><div id='wAk7w'><tfoot id='wAk7w'></tfoot><dl id='wAk7w'><fieldset id='wAk7w'></fieldset></dl></div>

                  <tbody id='wAk7w'></tbody>
                • <tfoot id='wAk7w'></tfoot>
                  本文介绍了Maven SonarQube 多模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个由几个模块组成的项目.

                  I have a project made up of several modules.

                  我正在尝试使用 SonarQube 分析这些.

                  I'm trying to analyse these with SonarQube.

                  我已将 Sonar Maven 插件作为依赖项包含在每个模块中:

                  I've included the Sonar Maven plugin as a dependency in each module:

                  <dependency>
                    <groupId>org.codehaus.sonar</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>5.1</version>
                  </dependency>
                  

                  然后我正在使用以下方式运行 Maven:

                  Then I'm running Maven using:

                  mvn clean 验证声纳:声纳

                  mvn clean verify sonar:sonar

                  Maven 成功完成,我可以看到 Sonar 分析正在进行,但是当我打开 Sonar UI 时,模块在项目中不可见.

                  Maven completes successfully and I can see the Sonar analysis happening however when I open the Sonar UI, the modules aren't visible in projects.

                  不过……

                  如果我从单个模块目录运行 Maven 命令,它在项目中是可见的.

                  If I run the Maven command from an individual module directory, it is visible in projects.

                  感觉我遗漏了一些非常简单的东西,感谢任何帮助!

                  Feel I'm missing something very simple, appreciate any help!

                  推荐答案

                  sonar-maven-plugin放到中,而不是作为依赖根pom.xml部分,如下:

                  Instead of as a dependency, put the sonar-maven-plugin in the <build> section of the root pom.xml, as follows:

                  <build>
                      <plugins>
                          <plugin>
                              <groupId>org.sonarsource.scanner.maven</groupId>
                              <artifactId>sonar-maven-plugin</artifactId>
                              <version>3.0.1</version>
                          </plugin>
                      </plugins>
                  </build>
                  

                  由于它是一个多模块项目,您应该 首先从根项目执行安装,然后作为专用步骤运行 sonar:sonar 目标,如下所示:

                  And since it's a multi-module project, you should first perform an install from the root project and then run the sonar:sonar goal as a dedicated step, as follows:

                  mvn clean install
                  mvn sonar:sonar
                  

                  要配置 sonarqube 服务器 URL,在 settings.xmlpom.xml 中指定 sonar.host.url 的项目属性,如下所示:

                  To configure the sonarqube server URL, specify a project property of sonar.host.url in your settings.xml or pom.xml as follows:

                  <properties>
                      <!-- Optional URL to server. Default value is http://localhost:9000 -->
                      <sonar.host.url>http://myserver:9000</sonar.host.url>
                  </properties>
                  

                  这篇关于Maven SonarQube 多模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在多台机器上使用一个声纳服务器 下一篇:声纳运行器:JAVA_HOME 存在但未指向有效的 Java 主文件夹

                  相关文章

                  <legend id='lEgnh'><style id='lEgnh'><dir id='lEgnh'><q id='lEgnh'></q></dir></style></legend>

                    <small id='lEgnh'></small><noframes id='lEgnh'>

                      <tfoot id='lEgnh'></tfoot>
                    1. <i id='lEgnh'><tr id='lEgnh'><dt id='lEgnh'><q id='lEgnh'><span id='lEgnh'><b id='lEgnh'><form id='lEgnh'><ins id='lEgnh'></ins><ul id='lEgnh'></ul><sub id='lEgnh'></sub></form><legend id='lEgnh'></legend><bdo id='lEgnh'><pre id='lEgnh'><center id='lEgnh'></center></pre></bdo></b><th id='lEgnh'></th></span></q></dt></tr></i><div id='lEgnh'><tfoot id='lEgnh'></tfoot><dl id='lEgnh'><fieldset id='lEgnh'></fieldset></dl></div>
                      • <bdo id='lEgnh'></bdo><ul id='lEgnh'></ul>