private void processArtifactSelectors()

in src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java [680:758]


    private void processArtifactSelectors(
            Set<File> artifacts,
            Set<String> artifactIds,
            Set<File> sourceArtifacts,
            Set<File> testArtifacts,
            Set<File> testSourceArtifacts,
            ArtifactSelector artifactSelector) {

        List<String> excludedArtifacts = new ArrayList<>();
        List<String> pomArtifacts = new ArrayList<>();
        List<String> emptySourceArtifacts = new ArrayList<>();
        List<String> emptyTestArtifacts = new ArrayList<>();
        List<String> emptyTestSourceArtifacts = new ArrayList<>();

        for (Artifact artifact : project.getArtifacts()) {
            if (!artifactSelector.isSelected(artifact)) {
                excludedArtifacts.add(artifact.getId());

                continue;
            }

            if ("pom".equals(artifact.getType())) {
                pomArtifacts.add(artifact.getId());
                continue;
            }

            getLog().info("Including " + artifact.getId() + " in the shaded jar.");

            artifacts.add(artifact.getFile());
            artifactIds.add(getId(artifact));

            if (createSourcesJar) {
                File file = resolveArtifactForClassifier(artifact, "sources");
                if (file != null) {
                    if (file.length() > 0) {
                        sourceArtifacts.add(file);
                    } else {
                        emptySourceArtifacts.add(artifact.getArtifactId());
                    }
                }
            }

            if (shadeTestJar) {
                File file = resolveArtifactForClassifier(artifact, "tests");
                if (file != null) {
                    if (file.length() > 0) {
                        testArtifacts.add(file);
                    } else {
                        emptyTestArtifacts.add(artifact.getId());
                    }
                }
            }

            if (createTestSourcesJar) {
                File file = resolveArtifactForClassifier(artifact, "test-sources");
                if (file != null) {
                    testSourceArtifacts.add(file);
                } else {
                    emptyTestSourceArtifacts.add(artifact.getId());
                }
            }
        }

        for (String artifactId : excludedArtifacts) {
            getLog().info("Excluding " + artifactId + " from the shaded jar.");
        }
        for (String artifactId : pomArtifacts) {
            getLog().info("Skipping pom dependency " + artifactId + " in the shaded jar.");
        }
        for (String artifactId : emptySourceArtifacts) {
            getLog().warn("Skipping empty source jar " + artifactId + ".");
        }
        for (String artifactId : emptyTestArtifacts) {
            getLog().warn("Skipping empty test jar " + artifactId + ".");
        }
        for (String artifactId : emptyTestSourceArtifacts) {
            getLog().warn("Skipping empty test source jar " + artifactId + ".");
        }
    }