protected DependencyStatusSets getClassifierTranslatedDependencies()

in src/main/java/org/apache/nifi/NarMojo.java [956:990]


    protected DependencyStatusSets getClassifierTranslatedDependencies(Set<Artifact> artifacts) throws MojoExecutionException {
        Set<Artifact> unResolvedArtifacts = new HashSet<>();
        Set<Artifact> resolvedArtifacts = artifacts;
        DependencyStatusSets status = new DependencyStatusSets();

        // possibly translate artifacts into a new set of artifacts based on the
        // classifier and type
        // if this did something, we need to resolve the new artifacts
        if (StringUtils.isNotEmpty(copyDepClassifier)) {
            ArtifactTranslator translator = new ClassifierTypeTranslator(artifactHandlerManager, copyDepClassifier, type);
            Set<ArtifactCoordinate> artifactCoordinates = translator.translate(artifacts, getLog());

            status = filterMarkedDependencies(artifacts);

            // the unskipped artifacts are in the resolved set.
            artifacts = status.getResolvedDependencies();
            unResolvedArtifacts.addAll(artifacts);

            // resolve the rest of the artifacts
            ArtifactResolver artifactResolver = new DefaultArtifactResolver();
            for (Artifact artifact : artifacts) {
                ArtifactResolutionRequest req = getArtifactResolutionRequest(artifact);
                ArtifactResolutionResult result = artifactResolver.resolve(req);
                if (result.getArtifacts() != null) {
                    unResolvedArtifacts.removeAll(result.getArtifacts());
                }
            }
        }

        // return a bean of all 3 sets.
        status.setResolvedDependencies(resolvedArtifacts);
        status.setUnResolvedDependencies(unResolvedArtifacts);

        return status;
    }