Stream<GradleProjectResolverExtension> (@Nullable ProjectResolverContext projectResolverContext) { return GradleProjectResolverExtension.EP_NAME.getExtensionList().stream().map(extension -> { try { Constructor<? extends GradleProjectResolverExtension> constructor = extension.getClass().getDeclaredConstructor(); constructor.setAccessible(true); GradleProjectResolverExtension resolverExtension = constructor.newInstance(); if (projectResolverContext != null) { resolverExtension.setProjectResolverContext(projectResolverContext); } return resolverExtension; } catch (Exception e) { LOG.error(e); } return null; }).sorted(ExternalSystemApiUtil.ORDER_AWARE_COMPARATOR); }