Analyse with Maven
Sonar uses a Maven plugin to analyze sources and to inject measures into the database. That's why database properties must be defined into the Maven configuration. Edit settings.xml file, located into $MAVEN_HOME/conf or ~/.m2, and add the parameters from step 3.
If data collection and server are on different boxes, set the server host with the property 'sonar.host.url'.
It is recommended to increase the Java heap memory. It avoids getting OutOfMemoryError failures. Set the MAVEN_OPTS environment variable :