Installation steps :
Step 1 : Download and unzip the distribution.
Do not install the application in a directory starting with a digit
Step 2 : Execute on Windows:
bin\windowsx8632\StartSonar.bat |
bin/[OS]/sonar.sh console |
Step 3 : Execute the following commands on your Maven projects:
mvn clean install mvn sonar:sonar |
Step 4 : Browse to http://localhost:9000
Step 5 : For administration features, default login/password is admin/admin.
Configuring Sonar to Maven :
Step 1 : Download and install maven 2.1 +
Step 2 : Edit the settings.xml file, located in $MAVEN_HOME/conf or ~/.m2, to set the database parameters to be used as well as the Sonar server URL.
---------------
<settings >
<profiles >
<profile >
<id>sonar</id >
<activation >
<activeByDefault>true</activeByDefault >
</activation >
<properties >
<!-- EXAMPLE FOR MYSQL -->
<sonar.jdbc.url >
jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
</sonar.jdbc.url >
<sonar.jdbc.driverClassName>com.mysql.jdbc.Driver</sonar.jdbc.driverClassName >
<sonar.jdbc.username>sonar</sonar.jdbc.username >
<sonar.jdbc.password>sonar</sonar.jdbc.password >
<!-- optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url >
http://myserver:9000
</sonar.host.url >
</properties >
</profile >
</profiles >
</settings >
-----------
Step 3 (Optional) : It is recommended to increase the Java heap memory. It avoids getting OutOfMemoryError failures. Set the MAVEN_OPTS environment variable:
----------------------------
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m"
----------------
Thanks, able to configure successfully based on your input.
ReplyDelete