RepositorySystemSession (@NotNull List<String> excludedDependencies) { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(sessionTemplate); if (excludedDependencies.isEmpty()) { return session; } session.setDependencySelector(new AndDependencySelector( session.getDependencySelector(), new ExclusionDependencySelector(exclusions(excludedDependencies))) ); session.setReadOnly(); return session; }