Search in sources :

Example 1 with SonarEdition

use of org.sonar.api.SonarEdition in project sonarqube by SonarSource.

the class ComputeEngineContainerImpl method populateLevel1.

private static void populateLevel1(Container container, Props props, ComputeEngineStatus computeEngineStatus) {
    Version apiVersion = MetadataLoader.loadVersion(System2.INSTANCE);
    SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
    container.add(props.rawProperties(), ThreadLocalSettings.class, new ConfigurationProvider(), new SonarQubeVersion(apiVersion), SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.COMPUTE_ENGINE, edition), CeProcessLogging.class, UuidFactoryImpl.INSTANCE, NetworkUtilsImpl.INSTANCE, WebServerImpl.class, LogbackHelper.class, DefaultDatabase.class, MyBatis.class, PurgeProfiler.class, ServerFileSystemImpl.class, new TempFolderProvider(), System2.INSTANCE, Paths2Impl.getInstance(), Clock.systemDefaultZone(), // DB
    new DaoModule(), ReadOnlyPropertiesDao.class, DBSessionsImpl.class, DbClient.class, // Elasticsearch
    new EsModule(), // rules/qprofiles
    RuleIndex.class, new OkHttpClientProvider(), computeEngineStatus, NoOpAuditPersister.class, CoreExtensionRepositoryImpl.class, CoreExtensionsLoader.class, CECoreExtensionsInstaller.class);
    container.add(toArray(CorePropertyDefinitions.all()));
}
Also used : SonarQubeVersion(org.sonar.api.SonarQubeVersion) EsModule(org.sonar.server.es.EsModule) Version(org.sonar.api.utils.Version) SonarQubeVersion(org.sonar.api.SonarQubeVersion) DatabaseVersion(org.sonar.server.platform.db.migration.version.DatabaseVersion) ConfigurationProvider(org.sonar.server.config.ConfigurationProvider) OkHttpClientProvider(org.sonar.server.util.OkHttpClientProvider) TempFolderProvider(org.sonar.server.platform.TempFolderProvider) DaoModule(org.sonar.db.DaoModule) SonarEdition(org.sonar.api.SonarEdition)

Example 2 with SonarEdition

use of org.sonar.api.SonarEdition in project sonarqube by SonarSource.

the class MetadataLoaderTest method load_edition_defaults_to_community_if_file_not_found.

@Test
public void load_edition_defaults_to_community_if_file_not_found() throws MalformedURLException {
    when(system.getResource(anyString())).thenReturn(new File("target/unknown").toURI().toURL());
    SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
    assertThat(edition).isEqualTo(SonarEdition.COMMUNITY);
}
Also used : File(java.io.File) SonarEdition(org.sonar.api.SonarEdition) Test(org.junit.Test)

Example 3 with SonarEdition

use of org.sonar.api.SonarEdition in project sonarqube by SonarSource.

the class MetadataLoaderTest method load_edition_from_file_in_classpath.

@Test
public void load_edition_from_file_in_classpath() {
    SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
    assertThat(edition).isNotNull();
}
Also used : SonarEdition(org.sonar.api.SonarEdition) Test(org.junit.Test)

Example 4 with SonarEdition

use of org.sonar.api.SonarEdition in project sonarqube by SonarSource.

the class PlatformLevel1 method configureLevel.

@Override
public void configureLevel() {
    add(platform, properties);
    addExtraRootComponents();
    Version apiVersion = MetadataLoader.loadVersion(System2.INSTANCE);
    SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
    add(new SonarQubeVersion(apiVersion), SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.SERVER, edition), ThreadLocalSettings.class, ConfigurationProvider.class, LogServerVersion.class, ProcessCommandWrapperImpl.class, RestartFlagHolderImpl.class, UuidFactoryImpl.INSTANCE, NetworkUtilsImpl.INSTANCE, UrlSettings.class, EmbeddedDatabaseFactory.class, LogbackHelper.class, WebServerProcessLogging.class, DefaultDatabase.class, MyBatis.class, PurgeProfiler.class, ServerFileSystemImpl.class, TempFolderCleaner.class, new TempFolderProvider(), System2.INSTANCE, Paths2Impl.getInstance(), DockerSupportImpl.class, Clock.systemDefaultZone(), // user session
    ThreadLocalUserSession.class, SystemPasscodeImpl.class, // DB
    DBSessionsImpl.class, DbClient.class, new DaoModule(), // Elasticsearch
    WebAuthorizationTypeSupport.class, new EsModule(), // rules/qprofiles
    RuleIndex.class, // issues
    IssueIndex.class, IssueIndexSyncProgressChecker.class, GlobalLockManagerImpl.class, new OkHttpClientProvider(), CoreExtensionRepositoryImpl.class, CoreExtensionsLoader.class, WebCoreExtensionsInstaller.class);
    addAll(CorePropertyDefinitions.all());
    // cluster
    add(WebServerImpl.class);
}
Also used : SonarQubeVersion(org.sonar.api.SonarQubeVersion) EsModule(org.sonar.server.es.EsModule) LogServerVersion(org.sonar.server.platform.LogServerVersion) Version(org.sonar.api.utils.Version) SonarQubeVersion(org.sonar.api.SonarQubeVersion) OkHttpClientProvider(org.sonar.server.util.OkHttpClientProvider) TempFolderProvider(org.sonar.server.platform.TempFolderProvider) DaoModule(org.sonar.db.DaoModule) SonarEdition(org.sonar.api.SonarEdition)

Example 5 with SonarEdition

use of org.sonar.api.SonarEdition in project sonarqube by SonarSource.

the class SpringGlobalContainer method addBootstrapComponents.

private void addBootstrapComponents() {
    Version apiVersion = MetadataLoader.loadVersion(System2.INSTANCE);
    SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
    DefaultAnalysisWarnings analysisWarnings = new DefaultAnalysisWarnings(System2.INSTANCE);
    LOG.debug("{} {}", edition.getLabel(), apiVersion);
    add(// plugins
    ScannerPluginRepository.class, PluginClassLoader.class, PluginClassloaderFactory.class, ScannerPluginJarExploder.class, ExtensionInstaller.class, new SonarQubeVersion(apiVersion), new GlobalServerSettingsProvider(), new GlobalConfigurationProvider(), new ScannerWsClientProvider(), DefaultServer.class, new GlobalTempFolderProvider(), analysisWarnings, UriReader.class, PluginFiles.class, System2.INSTANCE, Clock.systemDefaultZone(), new MetricsRepositoryProvider(), UuidFactoryImpl.INSTANCE, DefaultHttpDownloader.class, SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.SCANNER, edition), ScannerPluginInstaller.class, CoreExtensionRepositoryImpl.class, CoreExtensionsLoader.class, ScannerCoreExtensionsInstaller.class, DefaultGlobalSettingsLoader.class, DefaultNewCodePeriodLoader.class, DefaultMetricsRepositoryLoader.class);
}
Also used : SonarQubeVersion(org.sonar.api.SonarQubeVersion) MetricsRepositoryProvider(org.sonar.scanner.repository.MetricsRepositoryProvider) Version(org.sonar.api.utils.Version) SonarQubeVersion(org.sonar.api.SonarQubeVersion) DefaultAnalysisWarnings(org.sonar.scanner.notifications.DefaultAnalysisWarnings) SonarEdition(org.sonar.api.SonarEdition)

Aggregations

SonarEdition (org.sonar.api.SonarEdition)5 SonarQubeVersion (org.sonar.api.SonarQubeVersion)3 Version (org.sonar.api.utils.Version)3 Test (org.junit.Test)2 DaoModule (org.sonar.db.DaoModule)2 EsModule (org.sonar.server.es.EsModule)2 TempFolderProvider (org.sonar.server.platform.TempFolderProvider)2 OkHttpClientProvider (org.sonar.server.util.OkHttpClientProvider)2 File (java.io.File)1 DefaultAnalysisWarnings (org.sonar.scanner.notifications.DefaultAnalysisWarnings)1 MetricsRepositoryProvider (org.sonar.scanner.repository.MetricsRepositoryProvider)1 ConfigurationProvider (org.sonar.server.config.ConfigurationProvider)1 LogServerVersion (org.sonar.server.platform.LogServerVersion)1 DatabaseVersion (org.sonar.server.platform.db.migration.version.DatabaseVersion)1