Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonar 4.2 analysis both Java and JavaScript in same project

I'm trying to analyse my JEE project with Sonar 4.2. It's a multi-language JEE project with Java and JS.

The plugins I've added to my Sonar 4.2 are : Java 2.1 and JavaScript 1.6.

Recently, Sonar added the multi-language analysis, following the doc, I've removed the sonar.language from sonar-project.properties. But it still analyse only the Java.

I'm using Sonnar Runner 2.3 in Jenkins 1.555. It analyse the project after every build.

Am I missing something ?

Edit : sonar-project.properties :

# Required metadata
sonar.projectKey=myProjectKey
sonar.projectName=MyProject
sonar.projectVersion=1.0

# Path to the parent source code directory.
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional. If not set, SonarQube starts looking    for source code
# from the directory containing the sonar-project.properties file.
sonar.sources=src/main/java

# Encoding of the source code
sonar.sourceEncoding=UTF-8

Thanks

like image 697
Ismail Sen Avatar asked Apr 23 '14 11:04

Ismail Sen


1 Answers

You have Sonar looking for source code from src/main/java, so it won't find your js code. Change it to:

  sonar.sources=src/main

Sonar will automatically make the java analysis from /java, and the javascript analysis from /webapp

like image 134
DavidGarcia Avatar answered Oct 27 '22 21:10

DavidGarcia