fix(sonar): 增加sonarToken

master
youys 2 weeks ago
parent 3c6a5734dd
commit ecf6987fab

@ -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;
@ -72,6 +72,7 @@ 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);
@ -82,6 +83,7 @@ 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();
@ -93,6 +95,7 @@ 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();
@ -190,6 +193,7 @@ 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);

@ -45,8 +45,9 @@ excel.template.path=template.xlsx
sonar.url=http://127.0.0.1:9000 sonar.url=http://127.0.0.1:9000
#sonar.url=http://117.50.14.123:9000 #sonar.url=http://117.50.14.123:9000
# token令牌 # token令牌 02c142773360aebeedb4af1b178e20115ef46758
sonar.token=0253a518e824a976ea2f11aec17938cb0f8c0495 #sonar.token=0253a518e824a976ea2f11aec17938cb0f8c0495
sonar.token=02c142773360aebeedb4af1b178e20115ef46758
extract.path=/usr/local/bin/unar extract.path=/usr/local/bin/unar
#extract.path=/usr/bin/unar #extract.path=/usr/bin/unar

Loading…
Cancel
Save