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; }
public static boolean isMavenExtensionOnly(Object extension) { SupportedEnvironment env = AnnotationUtils.getAnnotation(extension, SupportedEnvironment.class); return env != null && env.value().length == 1 && StringUtils.equalsIgnoreCase("maven", env.value()[0]); }