Search in sources :

Example 1 with Version

use of org.sonar.api.utils.Version in project sonarqube by SonarSource.

the class GlobalContainer method addBootstrapComponents.

private void addBootstrapComponents() {
    Version apiVersion = ApiVersion.load(System2.INSTANCE);
    add(// plugins
    ScannerPluginRepository.class, PluginLoader.class, PluginClassloaderFactory.class, ScannerPluginJarExploder.class, ScannerPluginPredicate.class, ExtensionInstaller.class, new SonarQubeVersion(apiVersion), SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.SCANNER), StoragesManager.class, GlobalSettings.class, new ScannerWsClientProvider(), DefaultServer.class, new GlobalTempFolderProvider(), DefaultHttpDownloader.class, UriReader.class, new FileCacheProvider(), System2.INSTANCE, new MetricsRepositoryProvider(), UuidFactoryImpl.INSTANCE);
    addIfMissing(ScannerPluginInstaller.class, PluginInstaller.class);
    addIfMissing(DefaultSettingsLoader.class, SettingsLoader.class);
    addIfMissing(DefaultMetricsRepositoryLoader.class, MetricsRepositoryLoader.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) ApiVersion(org.sonar.api.internal.ApiVersion)

Example 2 with Version

use of org.sonar.api.utils.Version in project sonarqube by SonarSource.

the class LogServerVersion method start.

@Override
public void start() {
    String scmRevision = read("/build.properties").getProperty("Implementation-Build");
    Version version = runtime.getApiVersion();
    LOG.info("SonarQube {}", Joiner.on(" / ").skipNulls().join("Server", version, scmRevision));
}
Also used : Version(org.sonar.api.utils.Version)

Example 3 with Version

use of org.sonar.api.utils.Version in project sonarqube by SonarSource.

the class ServerImplTest method test_runtime.

@Test
public void test_runtime() throws IOException {
    settings.setProperty(CoreProperties.PERMANENT_SERVER_ID, "an_id");
    Version version = Version.create(6, 1);
    when(runtime.getApiVersion()).thenReturn(version);
    assertThat(underTest.getVersion()).isEqualTo(version.toString());
    assertThat(underTest.getPermanentServerId()).isEqualTo("an_id");
}
Also used : Version(org.sonar.api.utils.Version) Test(org.junit.Test)

Example 4 with Version

use of org.sonar.api.utils.Version in project sonarlint-core by SonarSource.

the class StandaloneGlobalContainer method doBeforeStart.

@Override
protected void doBeforeStart() {
    Version version = ApiVersion.load(System2.INSTANCE);
    add(StandalonePluginIndex.class, PluginRepository.class, PluginVersionChecker.class, PluginCacheLoader.class, PluginLoader.class, PluginClassloaderFactory.class, DefaultPluginJarExploder.class, ExtensionInstaller.class, new SonarQubeVersion(version), SonarRuntimeImpl.forSonarLint(version), new GlobalTempFolderProvider(), UriReader.class, new PluginCacheProvider(), System2.INSTANCE);
}
Also used : SonarQubeVersion(org.sonar.api.SonarQubeVersion) Version(org.sonar.api.utils.Version) SonarQubeVersion(org.sonar.api.SonarQubeVersion) ApiVersion(org.sonar.api.internal.ApiVersion) GlobalTempFolderProvider(org.sonarsource.sonarlint.core.container.global.GlobalTempFolderProvider) PluginCacheProvider(org.sonarsource.sonarlint.core.plugin.cache.PluginCacheProvider)

Example 5 with Version

use of org.sonar.api.utils.Version in project sonarqube by SonarSource.

the class PlatformLevel1 method configureLevel.

@Override
public void configureLevel() {
    add(platform, properties);
    addExtraRootComponents();
    Version apiVersion = ApiVersion.load(System2.INSTANCE);
    add(new SonarQubeVersion(apiVersion), SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.SERVER), ThreadLocalSettings.class, LogServerVersion.class, ProcessCommandWrapperImpl.class, RestartFlagHolderImpl.class, UuidFactoryImpl.INSTANCE, UrlSettings.class, EmbeddedDatabaseFactory.class, LogbackHelper.class, WebServerProcessLogging.class, DefaultDatabase.class, DatabaseChecker.class, // to avoid having two SqlSessionFactory instances
    org.sonar.core.persistence.MyBatis.class, PurgeProfiler.class, ServerFileSystemImpl.class, SemaphoresImpl.class, TempFolderCleaner.class, new TempFolderProvider(), System2.INSTANCE, // user session
    ThreadLocalUserSession.class, // DB
    DbClient.class, DaoModule.class, // Elasticsearch
    EsSearchModule.class, // rules/qprofiles
    RuleIndex.class, ActiveRuleIndex.class, // issues
    IssueIndex.class, new OkHttpClientProvider(), // Classes kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
    org.sonar.core.properties.PropertiesDao.class);
    addAll(CorePropertyDefinitions.all());
    // cluster
    add(ClusterImpl.class);
}
Also used : SonarQubeVersion(org.sonar.api.SonarQubeVersion) LogServerVersion(org.sonar.server.platform.LogServerVersion) Version(org.sonar.api.utils.Version) SonarQubeVersion(org.sonar.api.SonarQubeVersion) ApiVersion(org.sonar.api.internal.ApiVersion) OkHttpClientProvider(org.sonar.server.util.OkHttpClientProvider) TempFolderProvider(org.sonar.server.platform.TempFolderProvider)

Aggregations

Version (org.sonar.api.utils.Version)9 SonarQubeVersion (org.sonar.api.SonarQubeVersion)4 ApiVersion (org.sonar.api.internal.ApiVersion)4 Test (org.junit.Test)3 GlobalTempFolderProvider (org.sonarsource.sonarlint.core.container.global.GlobalTempFolderProvider)2 PluginCacheProvider (org.sonarsource.sonarlint.core.plugin.cache.PluginCacheProvider)2 Connection (java.sql.Connection)1 MetricsRepositoryProvider (org.sonar.scanner.repository.MetricsRepositoryProvider)1 LogServerVersion (org.sonar.server.platform.LogServerVersion)1 TempFolderProvider (org.sonar.server.platform.TempFolderProvider)1 OkHttpClientProvider (org.sonar.server.util.OkHttpClientProvider)1