Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sample Projects

To help you getting get started, a simple project sample is available on github that can be browsed or downloadedprojects/languages/java/ant/java-ant-simple

Multi-language Project

Since SonarQube 4.2, it is possible to run an analysis on a multi-language project. To do so, the sonar.language property just has to be removed.

To help you get started, a multi-language project sample can be browsed or downloaded from github: projects/languages/multi-language/multi-language-java-javascript-ant

Include Page
Include - Converting a Mono-language Project to a Multi-language Project
Include - Converting a Mono-language Project to a Multi-language Project

Multi-module Project

The configuration for parent and modules must be done in the parent build.xml file:

...

  • Modules with the same structure: projects/multi-module/ant/java-ant-modules-same-structure
  • Modules with different structures: projects/multi-module/ant/java-ant-modules-different-structures

Multi-module and Multi-language Project

Since SonarQube 3.3, it is possible to run an analysis on a multi-module project whose modules contains source code from different languages.

In addition to the multi-module configuration, the only mandatory property to set is the language for each module:

Code Block
titlemodule.sonar.language
linenumberstrue
languagebash
<property name="module1.sonar.language" value="java"/>
<property name="module2.sonar.language" value="js"/>
...

To help you getting started, a multi-language project sample is available on github that can be browsed or downloadedprojects/languages/multi-language/multi-language-java-javascript-ant

Advanced Usage

Additional analysis parameters can be defined in the build.xml file or through command-line parameters.