fix(sonar): 增加sonarToken

master
youys 2 weeks ago
parent 3c6a5734dd
commit ecf6987fab

@ -42,8 +42,8 @@ public class SonarService {
@Value("${sonar.url}")
String sonarUrl;
// @Value("${sonar.token}")
// String sonarToken;
@Value("${sonar.token}")
String sonarToken;
@Value("${extract.path}")
String extractProgramPath;
@ -72,6 +72,7 @@ public class SonarService {
"-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);
@ -82,6 +83,7 @@ public class SonarService {
"&& sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.login=" + sonarToken +
"-Dsonar.projectKey=" + param.getProjectKey() + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param.getCppCheckReportPath() + " " +
"-Dsonar.projectBaseDir=" + param.getProjectPath();
@ -93,6 +95,7 @@ public class SonarService {
"&& sonar-scanner " +
"-Dsonar.host.url=" + sonarUrl + " " +
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.login=" + sonarToken +
"-Dsonar.projectKey=" + param.getProjectKey() + " " +
"-Dsonar.cxx.cppcheck.reportPath=" + param.getCppCheckReportPath() + " " +
"-Dsonar.projectBaseDir=" + param.getProjectPath();
@ -190,6 +193,7 @@ public class SonarService {
"-Dsonar.sourceEncoding=utf-8 " +
"-Dsonar.projectKey=" + key + " " +
"-Dsonar.java.binaries=./ " +
"-Dsonar.login=" + sonarToken +
"-Dsonar.projectBaseDir=" + projectPath;
log.info("projectPath:{},key:{}, command: {}", projectPath, key, command);
SystemUtil.executeAndGetExitStatus(command);

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

Loading…
Cancel
Save