Frequently Asked Questions
Maven fails with 'java.lang.OutOfMemoryError'
Increase the maven available memory by setting the environment variable :
I get a SecurityException when I execute the maven plugin
The message of the root exception is
The CGLIB library available in your Maven repository is certainly signed which is not the case on IBIBLIO repository. Perhaps you or your Maven administrator have signed this jar to include it into a Java Web Start application. Unfortunately signing CGLIB jar file breaks Hibernate's use of CGLIB, as it generates proxy classes in the same package (org.sonar.commons.database.* for our context) as the original class. But the original Sonar class is not signed and the new proxy class is, generating a java.lang.SecurityException.
You must also sign Sonar libraries in your Maven repository or used unsigned CGLIB library.
Maven mirrors : the maven plugin fails to resolve org.codehaus.sonar.runtime.* dependencies
Sonar embedds its own maven repository which is used by the Sonar maven plugin to download commercial jdbc driver, pmd or checkstyle extensions, etc. Your maven settings.xml file must contain a section called <mirror> which should look like this :
According to this section, Maven redirect all call to a given repository to this central maven repository, so Sonar maven repository is never touched and Sonar maven plugin fails to resolve org.codehaus.sonar.runtime.* dependencies. Two solutions to solve this issue :
- If and only if you have Maven version 2.0.9, just change the value of <mirroOf> parameter in your setting.xml file by adding : "*,!sonar"
- Configure your central maven repository (eg. nexus, archiva or artifactory) to use the Sonar internal repository (http://sonar:9000/deploy/maven). Don't worry if this URL returns 404, it's normal. To check if it works, browse to http://<servername>/deploy/maven/README.
Note that this is a snapshots repository, so do not forget to set the repository policy to 'snapshot'.
Corbertura exception on Linux System while accessing the cobertura.ser file
When reading the cobertura.ser file, the Cobertura Maven plugin tries to get a lock on that file. This locking mechanism generates an exception on Linux Systems SONAR-172.
The current workaround is to add the following lines to the pom.xml file (thanks to Wouter de Vaal) :