@ -42,8 +42,8 @@ public class SonarService {
@Value ( "${sonar.url}" )
@Value ( "${sonar.url}" )
String sonarUrl ;
String sonarUrl ;
@Value ( "${sonar.token}" )
// @Value("${sonar.token}")
String sonarToken ;
// String sonarToken;
@Value ( "${extract.path}" )
@Value ( "${extract.path}" )
String extractProgramPath ;
String extractProgramPath ;
@ -61,7 +61,6 @@ public class SonarService {
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.java.binaries=./ " +
"-Dsonar.java.binaries=./ " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
@ -73,7 +72,6 @@ public class SonarService {
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
@ -84,7 +82,6 @@ public class SonarService {
"&& sonar-scanner " +
"&& sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param . getCppCheckReportPath ( ) + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param . getCppCheckReportPath ( ) + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
@ -96,37 +93,12 @@ public class SonarService {
"&& sonar-scanner " +
"&& sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param . getCppCheckReportPath ( ) + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param . getCppCheckReportPath ( ) + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
log . info ( "c++: command:{}, result:{}" , command , executeResp . getOutput ( ) ) ;
log . info ( "c++: command:{}, result:{}" , command , executeResp . getOutput ( ) ) ;
} ) ;
} ) ;
concurrentHashMap . put ( Constant . H , param - > {
String command = "sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
log . info ( "H语言 command: {},result:{}" , command , executeResp . getOutput ( ) ) ;
} ) ;
concurrentHashMap . put ( Constant . OTHER , param - > {
String command = "sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.projectKey=" + param . getProjectKey ( ) + " " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectBaseDir=" + param . getProjectPath ( ) ;
SystemUtil . ExecuteResp executeResp = SystemUtil . executeAndGetExitStatus ( command ) ;
log . info ( "Other语言 command:{},result:{}" , command , executeResp . getOutput ( ) ) ;
} ) ;
}
}
/ * *
/ * *
@ -218,7 +190,6 @@ public class SonarService {
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.projectKey=" + key + " " +
"-Dsonar.projectKey=" + key + " " +
"-Dsonar.java.binaries=./ " +
"-Dsonar.java.binaries=./ " +
"-Dsonar.login=" + sonarToken + " " +
"-Dsonar.projectBaseDir=" + projectPath ;
"-Dsonar.projectBaseDir=" + projectPath ;
log . info ( "projectPath:{},key:{}, command: {}" , projectPath , key , command ) ;
log . info ( "projectPath:{},key:{}, command: {}" , projectPath , key , command ) ;
SystemUtil . executeAndGetExitStatus ( command ) ;
SystemUtil . executeAndGetExitStatus ( command ) ;
@ -226,7 +197,6 @@ public class SonarService {
/ * *
/ * *
* 是 否 是 支 持 的 语 言
* 是 否 是 支 持 的 语 言
*
* @param language
* @param language
* @return
* @return
* /
* /