Skip to content
Advertisement

Running sonar analysis with mvn sonar:sonar ignores sonar-project.properties

Latest 3.3 sonar-maven-plugin and 5.6 LTS as web server.
Running sonar analysis with mvn sonar:sonar ( Scanner for Maven )
ignores sonar-project.properties file. (with many parameters https://docs.sonarqube.org/display/SONAR/Analysis+Parameters)

Is it that the expected behavior?
So do I have to configure all sonar parameters within pom.xml files?

Advertisement

Answer

Other way would be to configure reading via Maven Properties Plugin

Q&A

   <build>    
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <phase>initialize</phase>
            <goals>
              <goal>read-project-properties</goal>
            </goals>
            <configuration>
              <files>
                <file>sonar-project.properties</file>
              </files>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement