How to make SonarQube module analyze the project only once when sonar analysis is bound to maven lifecycle in a multi-module project?

前端 未结 1 1926
终归单人心
终归单人心 2020-12-19 11:43

What I am trying to achieve is integrate SonarQube analysis into the build process, so that whenever mvn clean install is run, the code is analyzed with SonarQu

相关标签:
1条回答
  • 2020-12-19 12:17

    IMO, this is just a Maven configuration issue, you're missing the <inherited>false</inherited> element on the execution of sonar:sonar:

                    <!-- Run sonar analysis (preview mode) during verify phase. Cobertura reports need to be generated already -->
                    <plugin>
                       <groupId>org.codehaus.mojo</groupId>
                       <artifactId>sonar-maven-plugin</artifactId>
                       <version>2.5</version>
                       <executions>
                            <execution>
                               <phase>verify</phase>
                               <goals>
                                  <goal>sonar</goal>
                               </goals>
                               <inherited>false</inherited>
                            </execution>
                      </executions>
                    </plugin>
    
    0 讨论(0)
提交回复
热议问题