2014-04-10 59 views
0

我使用SonarQube 4.2與SCM活性[scmactivity] 1.7與聲納的行家-插件4.2設置編碼SCM活動插件聲納Maven的插件?

在執行mvn sonar:sonar我看到以下內容:

[INFO] --- sonar-maven-plugin:4.2:sonar (default-cli) @ ... --- 
INFO: Default locale: "en_US", source code encoding: "UTF-8" 
INFO: Work directory: ...\target\sonar 
INFO: SonarQube Server 4.2 
... 
[INFO] [15:43:51.829] Source encoding: UTF-8, default locale: en_US 
... 
[INFO] [15:43:59.169] Sensor ScmActivitySensor... 
[INFO] [15:43:59.169] Trying to guess scm provider from project layout... 
[INFO] [15:43:59.170] Found SCM type: svn 
[INFO] [15:43:59.170] Retrieve SCM blame information with encoding windows-1250... 
[INFO] [15:43:59.343] Retrieve SCM blame information with encoding windows-1250 done: 173 ms 
[INFO] [15:43:59.345] Sensor ScmActivitySensor done: 176 ms 

如何編碼被設置爲一個又一個,說UTF-8?

回答

0

嘗試添加這些到POM的properties部分:

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
+0

沒有變化。我有'sourceEncoding'已經當我問的問題,並與'outputEncoding'它並沒有改變 - 仍然'用編碼Windows的1250'後'源編碼:UTF-8,默認的語言環境:en_US'。 –

+0

我更新了我的問題中的日誌,其中包含聲納執行不同階段的編碼信息。 –

0

目前你不能。這是負責印刷的編碼行:

TimeProfiler profiler = new TimeProfiler().start("Retrieve SCM blame information with encoding " + Charset.defaultCharset()); 

然而,事實並非如此,因爲作者的名字總是規範化和剝奪的所有非ASCII字符:

authors.add(lineNumber, normalizeString(line.getAuthor())); 
... 
private String normalizeString(String inputString) { 
    String lowerCasedString = inputString.toLowerCase(); 
    String stringWithoutAccents = removeAccents(lowerCasedString); 
return removeNonAsciiCharacters(stringWithoutAccents); 

因此,實際上,編碼沒有影響。