2

when I build my project I usually call mvn clean install.

Now I tried to integrate sonarqube analysis. Therefore I created a new Run Configuration in Eclipse where I execute the goal mvn sonar:sonar with some parameters.

Is there a way to run sonar:sonar within the mvn clean install automatially?

matthias
  • 1,938
  • 23
  • 51

1 Answers1

1

This should be documented in "Analyzing with SonarQube Scanner for Maven".
It will be triggered in the build phase.

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

Then see "Running sonar analysis with mvn sonar:sonar ignores sonar-project.properties".
To associate it with an existing lifecycle phase seems problematic.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250