private List downloadBundles()

in src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java [816:863]


    private List<File> downloadBundles(List<String> bundles) throws MojoExecutionException {
        List<File> bundleArtifacts = new ArrayList<>();

        for (String artifactDescriptor : bundles) {
            getLog().info("Preparing remote bundle " + artifactDescriptor);
            // groupId:artifactId:version[:type[:classifier]]
            String[] s = artifactDescriptor.split(":");

            File artifactFile = null;
            // check if the artifact is part of the reactor
            if (mavenSession != null) {
                List<MavenProject> list = mavenSession.getProjects();
                for (MavenProject p : list) {
                    if (s[0].equals(p.getGroupId()) && s[1].equals(p.getArtifactId()) && s[2].equals(p.getVersion())) {
                        if (s.length >= 4 && "test-jar".equals(s[3])) {
                            artifactFile = new File(p.getBuild().getTestOutputDirectory());
                        } else {
                            artifactFile = new File(p.getBuild().getOutputDirectory());
                        }
                    }
                }
            }
            if (artifactFile == null || !artifactFile.exists()) {
                String g = s[0];
                String a = s[1];
                String v = s[2];
                String type = s.length >= 4 ? s[3] : "jar";
                ArtifactType artifactType =
                        RepositoryUtils.newArtifactType(type, artifactHandlerManager.getArtifactHandler(type));
                String classifier = s.length == 5 ? s[4] : artifactType.getClassifier();

                DefaultArtifact artifact =
                        new DefaultArtifact(g, a, classifier, artifactType.getExtension(), v, artifactType);

                try {
                    ArtifactRequest request =
                            new ArtifactRequest(artifact, project.getRemoteProjectRepositories(), "remote-resources");
                    ArtifactResult result = repoSystem.resolveArtifact(mavenSession.getRepositorySession(), request);
                    artifactFile = result.getArtifact().getFile();
                } catch (ArtifactResolutionException e) {
                    throw new MojoExecutionException("Error processing remote resources", e);
                }
            }
            bundleArtifacts.add(artifactFile);
        }

        return bundleArtifacts;
    }