Source code encoding should be set to UTF-8 to prevent cross-platform encoding issues.
UTF-8 is specified in parent POMs, so it is used by Maven when building the projects. However, it may not be set by default in your prefered IDE. The best practice is to force it for all your source code.
Configure your IDE with the correct code style: see the section "IDE Support".
The development mode is used to edit Ruby on Rails code. The application is automatically reloaded when Ruby files are saved. It avoids restarting the server. Changes are reloaded on the fly. Execute one of the following commands from the sonar-server/ directory to start the server :
sonar-server/derby-start.sh # for embedded database sonar-server/mysql-start.sh # for MySql sonar-server/postgresql-start.sh # for PostgreSQL |
Then ruby code can be directly edited from sonar-server/src/main/webapp/WEB-INF/app.
Execute mvnDebug instead of mvn :
mvnDebug sonar:sonar |
Example in Intellij Idea : Run -> Edit configurations -> Add new configuration -> Remote -> port 8000.
Here is how to log all the SQL requests executed from server :
IMPORTANT: Change the configuration of logback.xml because if not modified everything will be logged (http://code.google.com/p/log4jdbc/#5._Set_up_your_loggers)
<logger name="jdbc.sqltiming">
<level value="OFF"/>
<appender-ref ref="PROFILING_FILE"/>
</logger>
<logger name="jdbc.connection">
<level value="INFO"/>
<appender-ref ref="PROFILING_FILE"/>
</logger>
<logger name="jdbc.audit">
<level value="OFF"/>
<appender-ref ref="PROFILING_FILE"/>
</logger>
<logger name="jdbc.resultset">
<level value="OFF"/>
<appender-ref ref="PROFILING_FILE"/>
</logger>
<logger name="jdbc.sqlonly">
<level value="OFF"/>
<appender-ref ref="PROFILING_FILE"/>
</logger> |
Restart sonar and you should be able to see :
2012.07.02 16:04:06 INFO jdbc.sqltiming select params0_.rule_id as rule6_1_, params0_.id as id1_, params0_.id as id18_0_, params0_.default_value
as default2_18_0_, params0_.description as descript3_18_0_, params0_.name as name18_0_, params0_.rule_id
as rule6_18_0_, params0_.param_type as param5_18_0_ from rules_parameters params0_ where params0_.rule_id=679
{executed in 0 msec}
|