Sonar 4.2 analysis both Java and JavaScript in same project

雨燕双飞 提交于 2019-12-01 02:51:12

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/23243351/sonar-4-2-analysis-both-java-and-javascript-in-same-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!