private void projectBootstrap() {
// Views pass a custom ProjectReactor
ProjectReactor reactor = getComponentByType(ProjectReactor.class);
if (reactor == null) {
// OK, not present, so look for a deprecated custom ProjectBootstrapper for old versions of SQ Runner
ProjectBootstrapper bootstrapper = getComponentByType(ProjectBootstrapper.class);
Settings settings = getComponentByType(Settings.class);
if (bootstrapper == null
// Starting from Maven plugin 2.3 then only DefaultProjectBootstrapper should be used.
|| "true".equals(settings.getString("sonar.mojoUseRunner"))) {
// Use default SonarRunner project bootstrapper
ProjectReactorBuilder builder = getComponentByType(ProjectReactorBuilder.class);
reactor = builder.execute();
} else {
reactor = bootstrapper.bootstrap();
}
if (reactor == null) {
throw new SonarException(bootstrapper + " has returned null as ProjectReactor");
}
add(reactor);