How to Use sonar to analyze maven project

SonarQube® software (previously called Sonar) is an open source quality management platform, dedicated to continuously analyze and measure technical quality, from project portfolio to method.

Run sonar:

$ cd Downloads/sonarqube-4.1/bin/linux-x86-64
$ ./sonar.sh console &

Put the following in ~/.m2/settings.xml
<settings>
    <profiles>
        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <!-- optional URL to server. Default value is http://localhost:9000 -->
                <sonar.host.url>
                  http://localhost:9000
                </sonar.host.url>
            </properties>
        </profile>
     </profiles>
</settings>
 Execute the following 2 maven goals:

mvn clean install -DskipTests=true
mvn sonar:sonar
visit  http://localhost:9000 in your browser.

Popular posts from this blog

How to delete / clear queue of PowerMTA