...
- Clone $MAVEN_HOME/bin/mvnDebug to mvnJProfiler and replace the MAVEN_DEBUG_OPTS property by :
MAVEN_DEBUG_OPTS="-Xint -agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar" - Start JProfiler -> Connect to an application on a remote computer
Tips and tricks
Connect to Derby from command line
- download derby (the same version as used by sonar)
- set the DERBY_HOME property
- execute the command $DERBY_HOME/bin/ij
connect to the database :
Code Block ij version 10.3 ij> connect 'jdbc:derby://localhost:1527/sonar;user=sonar;password=sonar'; ij> show tables;
Compare XML files in JUnit
Use XMLUnit. The dependency is already defined into maven.
| Code Block |
|---|
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
XMLUnit.setIgnoreWhitespace(true);
Diff diff = XMLUnit.compareXML(xml1, xml2);
assertTrue(diff.similar());
|
Warning : There's a bug on the similar() method. Contrary to the documentation, it fails if nodes are not in the same order.
Freeze Ruby gems
Ruby gems are used in the webapp (directory src/main/webapp of the sonar-server module). They are delivered with the application. To install or upgrade a gem :
- copy the gem from local ruby installation into WEB-INF/vendor/gems.
- execute "jruby -S gem specification <gemname> > .specification" from WEB-INF/vendor/gems/<gemname>. It generates the .specification file.
- commit the directory WEB-INF/vendor/gems
Log server-side SQL requests
...

