sonar新版java不能分析的问题

This commit is contained in:
huang 2018-06-28 17:04:00 +08:00
parent 8c18d59a9c
commit d9a0378cd1
1 changed files with 12 additions and 1 deletions

View File

@ -51,12 +51,23 @@ class QualityAnalysisController < ApplicationController
path = params[:path].blank? ? "./" : params[:path]
# qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
version = 1
properties = "sonar.projectKey=#{sonar_name}
if language == "java"
properties = "sonar.projectKey=#{sonar_name}
sonar.projectName=#{sonar_name}
sonar.projectVersion=#{version}
sonar.sources=#{path}
sonar.language=#{language.downcase}
sonar.sourceEncoding=utf-8
sonar.java.binaries=./"
else
properties = "-Dsonar.projectKey=#{sonar_name}
sonar.projectName=#{sonar_name}
sonar.projectVersion=#{version}
sonar.sources=#{path}
sonar.language=#{language.downcase}
sonar.sourceEncoding=utf-8"
end
git_url = @gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git"
# 替换配置文件