Skip to end of metadata
Go to start of metadata

Prerequisites

Checkout Sources

Setup GIT

If you have never used git before, you need to do some setup first. Run the following commands so that GIT knows your name and email.

Setup line endings preferences :

  • For Unix/Mac users :

  • For Windows users :

Clone GIT repository

Sources can be checked out anonymously from GitHub :

Committers must configure their SSH key (see GitHub documentation for Windows and Mac) and clone repository with the following URL :

Build Sources

Increase the memory allocated to Maven (replace 'export' by 'set' on Windows) :

Some artifacts used by SonarQube are not in Central repository (e.g. fikin-ant), so you should ensure that SonarQube repository ( defined in pom.xml ) will be used :

To run a complete build, execute "mvn clean install" in the root of the project directory. To quickly build in development environments, the script "quick-build.sh" does not execute unit tests and compile GWT components for Firefox only.

The distribution is generated in the directory sonar-application/target.

Profiles

Profile identifierActivationDescription
devDeactivated by default. Can be activated with -Pdev 
releaseDeactivated by default. Can be activated with -Prelease 
javadocDeactivated by default. Can be activated with -Pjavadoc 
m2eActivated in Eclipse. 

IDE support

The following guidelines must be applied to SonarQubeand to the plugins that are hosted at Codehaus.

Eclipse

  1. Install Anyedit Eclipse Plugin
  2. Optional: if Maven projects do not define the profile ‘m2e’, then install the M2E error disabler plugin
  3. Restart Eclipse
  4. Windows → Preferences
    • General
      • Workspace
        • Text file encoding: UTF-8
      • Editors → AnyEdit Tools
        • Remove trailing whitespace
        • Create new line at the end of file
        • Convert tabs – spaces
        • Default convert mode on save: Tabs to spaces
    • Java → Code Style
    • XML → XML Files → Editor
      • Indent using spaces
      • Indentation size: 2
  5. Open the Maven project: File → Import → Maven → Existing Maven Projects → select the root directory containing the file pom.xml

IntelliJ IDEA

  1. Download sonar-codestyle.xml to
    • ~/Library/Preferences/IntellijIdea/codestyles/ on Mac OS
    • ~/.IntellijIdea/config/codeStyles/ on Linux
    • ~\.IntellijIdea\config\codeStyles\ on Windows
  2. (Re)start IntellIJ IDEA
  3. Open the Maven project: File → Open Project → select the file pom.xml
  4. Use UTF-8 encoding: Project Settings → File Encodings → IDE Encoding: UTF-8
  5. Change the code style: Project Settings → Code Style → Scheme: sonar
Labels
  • None