use of org.sonar.scanner.bootstrap.GlobalAnalysisMode in project sonarqube by SonarSource.
the class SpringProjectScanContainer method doAfterStart.
@Override
protected void doAfterStart() {
getComponentByType(ProjectLock.class).tryLock();
GlobalAnalysisMode analysisMode = getComponentByType(GlobalAnalysisMode.class);
InputModuleHierarchy tree = getComponentByType(InputModuleHierarchy.class);
ScanProperties properties = getComponentByType(ScanProperties.class);
properties.validate();
properties.get("sonar.branch").ifPresent(deprecatedBranch -> {
throw MessageException.of("The 'sonar.branch' parameter is no longer supported. You should stop using it. " + "Branch analysis is available in Developer Edition and above. See https://redirect.sonarsource.com/editions/developer.html for more information.");
});
BranchConfiguration branchConfig = getComponentByType(BranchConfiguration.class);
if (branchConfig.branchType() == BranchType.PULL_REQUEST) {
LOG.info("Pull request {} for merge into {} from {}", branchConfig.pullRequestKey(), pullRequestBaseToDisplayName(branchConfig.targetBranchName()), branchConfig.branchName());
} else if (branchConfig.branchName() != null) {
LOG.info("Branch name: {}", branchConfig.branchName());
}
getComponentByType(ProjectFileIndexer.class).index();
// Log detected languages and their profiles after FS is indexed and languages detected
getComponentByType(QProfileVerifier.class).execute();
scanRecursively(tree, tree.root());
LOG.info("------------- Run sensors on project");
getComponentByType(ProjectSensorsExecutor.class).execute();
getComponentByType(ScmPublisher.class).publish();
getComponentByType(CpdExecutor.class).execute();
getComponentByType(ReportPublisher.class).execute();
if (properties.shouldWaitForQualityGate()) {
LOG.info("------------- Check Quality Gate status");
getComponentByType(QualityGateCheck.class).await();
}
getComponentByType(PostJobsExecutor.class).execute();
if (analysisMode.isMediumTest()) {
getComponentByType(AnalysisObservers.class).notifyEndOfScanTask();
}
}
Aggregations