public Set resolve()

in core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/SystemDependencyResolution.java [52:96]


    public Set<String> resolve(List<String> exclusions) throws IOException {

        final Set<String> archivesPaths = new HashSet<>();

        exclusions.replaceAll(s -> s.replace('.', File.separatorChar));

        if (classpath != null) {
            ApplicationEnvironment env = ApplicationEnvironment.get();
            Set<String> classpathElements = new HashSet<>();
            Set<String> providedGAVs = new HashSet<>();
            List<String> testClasspathElements = testClasspath != null ? testClasspath : Collections.emptyList();

            for (final String element : classpath) {
                if (!element.startsWith(javaHome) && !element.startsWith(pwd + File.separatorChar) && !element.endsWith(".pom")) {
                    // explicit exclusions
                    if (!excluded(exclusions, element)) {
                        classpathElements.add(element);
                    }
                }
            }

            //  prepare the list of provided dep's, these will be implicitly excluded
            providedGAVs.addAll(
                    env.getRemovableDependencies()
                            .stream()
                            .map(e -> e.split(":"))
                            .map(e -> e[0] + File.separatorChar + e[1] + File.separatorChar)
                            .map(m -> (useGradleRepo ? m : m.replace('.', File.separatorChar)))
                            .collect(Collectors.toList())
            );


            // implicit exclusions
            for (final String element : classpathElements) {
                boolean excludedByProvidedGAVs = excluded(providedGAVs, element);
                boolean excludedByTestClasspath = excluded(testClasspathElements, element);

                if (!excludedByProvidedGAVs && !excludedByTestClasspath) {
                    archivesPaths.add(element);
                }
            }
        }

        return archivesPaths;
    }