public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
@Test public void test_bean() { EnvironmentInformation env = new EnvironmentInformation("Maven Plugin", "2.0"); assertThat(env.getKey()).isEqualTo("Maven Plugin"); assertThat(env.getVersion()).isEqualTo("2.0"); }
private boolean isRunnerVersionLessThan2Dot4() { EnvironmentInformation env = this.getComponentByType(EnvironmentInformation.class); // Starting from SQ Runner 2.4 the key is "SonarQubeRunner" return env != null && "SonarRunner".equals(env.getKey()); }
public static boolean supportsEnvironment(Object extension, EnvironmentInformation environment) { SupportedEnvironment env = AnnotationUtils.getAnnotation(extension, SupportedEnvironment.class); if (env == null) { return true; } for (String supported : env.value()) { if (StringUtils.equalsIgnoreCase(environment.getKey(), supported)) { return true; } } return false; }
private LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }