use of org.sonar.application.config.AppSettingsLoader in project sonarqube by SonarSource.
the class App method start.
public void start(String[] cliArguments) throws IOException {
AppSettingsLoader settingsLoader = new AppSettingsLoaderImpl(cliArguments);
AppSettings settings = settingsLoader.load();
// order is important - logging must be configured before any other components (AppFileSystem, ...)
AppLogging logging = new AppLogging(settings);
logging.configure();
AppFileSystem fileSystem = new AppFileSystem(settings);
try (AppState appState = new AppStateFactory(settings).create()) {
appState.registerSonarQubeVersion(getSonarqubeVersion());
AppReloader appReloader = new AppReloaderImpl(settingsLoader, fileSystem, appState, logging);
JavaCommandFactory javaCommandFactory = new JavaCommandFactoryImpl(settings);
fileSystem.reset();
try (JavaProcessLauncher javaProcessLauncher = new JavaProcessLauncherImpl(fileSystem.getTempDir())) {
Scheduler scheduler = new SchedulerImpl(settings, appReloader, javaCommandFactory, javaProcessLauncher, appState);
// intercepts CTRL-C
Runtime.getRuntime().addShutdownHook(new ShutdownHook(scheduler));
scheduler.schedule();
stopRequestWatcher = StopRequestWatcherImpl.create(settings, scheduler, fileSystem);
stopRequestWatcher.startWatching();
scheduler.awaitTermination();
stopRequestWatcher.stopWatching();
}
systemExit.exit(0);
}
}
Aggregations