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:
Put the following in ~/.m2/settings.xml
Run sonar:
$ cd Downloads/sonarqube-4.1/bin/linux-x86-64
$ ./sonar.sh console &
Put the following in ~/.m2/settings.xml
<settings>Execute the following 2 maven goals:
<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>
mvn clean install -DskipTests=true
mvn sonar:sonarvisit http://localhost:9000 in your browser.
Comments
Post a Comment