Resolve the given collection of ArtifactSpec references. This method attempts the resolution and ensures that the
references are updated to be as complete as possible.

@param collection the collection artifact specifications.
558526
private static void resolveDependencies(Collection<ArtifactSpec> collection, ShrinkwrapArtifactResolvingHelper helper) {
        // Identify the artifact specs that need resolution.
        // Ideally, there should be none at this point.
        collection.forEach(spec -> {
            if (spec.file == null) {
                // Resolve it.
                ArtifactSpec resolved = helper.resolve(spec);
                if (resolved != null) {
                    spec.file = resolved.file;
                } else {
                    throw new IllegalStateException("Unable to resolve artifact: " + spec.toString());
                }
            }
        });
    }
615259
private void resolveArtifacts( List<Artifact> artifacts, String artifactGAVs )
        throws ArtifactNotFoundException, ArtifactResolutionException
    {
        if ( artifactGAVs != null && artifactGAVs.trim().length() > 0 )
        {
            String[] scalacPluginsGAVs = artifactGAVs.trim().split( " " );
            for ( String scalacPluginGAV : scalacPluginsGAVs )
            {
                String[] gav = scalacPluginGAV.split( ":" );
                String groupId = gav[ 0 ];
                String artifactId = gav[ 1 ];
                String version = gav[ 2 ];
                Artifact scalacPluginArtifact = getResolvedArtifact( groupId, artifactId, version );
                if ( scalacPluginArtifact != null )
                {
                    artifacts.add( scalacPluginArtifact );
                }
            }
        }
    }
610324
public static Collection<? extends Artifact> filter(Collection<Artifact> artifacts) {
        LinkedHashSet<Artifact> set = new LinkedHashSet<>();
        for (Artifact artifact : artifacts) {
            if (MavenArtifact.isValid(artifact)) {
                set.add(artifact);
            }
        }
        return set;
    }
466488
public void setTemplateResolvers(final Set<ITemplateResolver> templateResolvers) {
        Validate.notNull(templateResolvers, "Template Resolver set cannot be null");
        checkNotInitialized();
        this.templateResolvers.clear();
        for (final ITemplateResolver templateResolver : templateResolvers)  {
            addTemplateResolver(templateResolver);
        }
    }
487669
@Override
    protected Artifact createArtifact(final ArtifactItem item) throws MojoExecutionException {
        assert item != null;
        
        if (item.getVersion() == null) {
            throw new MojoExecutionException("Unable to find artifact without version specified: " + item.getGroupId()
                + ":" + item.getArtifactId() + ":" + item.getVersion() + " in either project dependencies or in project dependencyManagement.");
        }
        
        // if version is a range get the highest available version
        if (item.getVersion().trim().startsWith("[") || item.getVersion().trim().startsWith("(") ) {
            try {
                item.setVersion(resolveVersionRange(item.getGroupId(), item.getArtifactId(), item.getType(), item.getVersion()));
            } catch (VersionRangeResolutionException e) {
                throw new MojoExecutionException("Could not get the highest version from the range: " + item.getVersion(), e);
            }
        }
        
        return resolveArtifactItem(item);
    }
747773
private Artifact getResolvedArtifact( String groupId, String artifactId, String version )
        throws ArtifactNotFoundException, ArtifactResolutionException
    {
        Artifact artifact = factory.createArtifact( groupId, artifactId, version, Artifact.SCOPE_RUNTIME, "jar" );
        resolver.resolve( artifact, remoteRepos, localRepo );
        return artifact;
    }
1182937
public static boolean artifactIsNotExcluded(Collection<Exclusion> exclusions, Artifact artifact) {
        return Optional.ofNullable(exclusions).orElse(Collections.emptyList())
                .stream().noneMatch(selectedExclusion ->
                        null != artifact && selectedExclusion.getGroupId().equals(artifact.getGroupId()) &&
                                (selectedExclusion.getArtifactId().equals(artifact.getArtifactId()) || (selectedExclusion.getArtifactId().equals(ARTIFACT_STAR)))
                );
    }
904832
private void refreshValidIssues(FeatureCollector collector, List<Team> teams, Set<Scope> scopes) {
        long refreshValidIssuesStart = System.currentTimeMillis();
        List<String> lookUpIds = Objects.equals(collector.getMode(), JiraMode.Board) ? teams.stream().map(Team::getTeamId).collect(Collectors.toList()) : scopes.stream().map(Scope::getpId).collect(Collectors.toList());
        lookUpIds.forEach(l -> {
            LOGGER.info("Refreshing issues for " + collector.getMode() + " ID:" + l);
            List<String> issueIds = jiraClient.getAllIssueIds(l, collector.getMode());
            List<Feature> existingFeatures = Objects.equals(collector.getMode(), JiraMode.Board) ? featureRepository.findAllByCollectorIdAndSTeamID(collector.getId(), l) : featureRepository.findAllByCollectorIdAndSProjectID(collector.getId(), l);
            List<Feature> deletedFeatures = existingFeatures.stream().filter(e -> !issueIds.contains(e.getsId())).collect(Collectors.toList());
            deletedFeatures.forEach(d -> {
                LOGGER.info("Deleting Feature " + d.getsId() + ':' + d.getsName());
                featureRepository.delete(d);
            });
        });
        log(collector.getMode() + " Issues Refreshed ", refreshValidIssuesStart);
    }
1176620
public void add(ArtifactInfo<BundleInfoContext> bundleInfo) {
        List<ArtifactInfo<BundleInfoContext>> list = artifacts.get(bundleInfo.getId());
        if (list == null) {
            list = new ArrayList<>();
            artifacts.put(bundleInfo.getId(), list);
        }
        list.add(bundleInfo);
        Collections.sort(list, Collections.reverseOrder());
    }
614151
protected function resolveItems(Collection &$items): void
    {
        $resolver = function ($property) {
            return $this->resolve($property) ?: $property;
        };

        $items->each(function (MenuItem $item) use ($resolver) {
            $item->fill(array_map($resolver, $item->properties));
        });
    }
703550
@SuppressWarnings("rawtypes")
  protected int resolveNrOfInstances(DelegateExecution execution) {
    if (loopCardinalityExpression != null) {
      return resolveLoopCardinality(execution);

    } else if(usesCollection()) {
      Collection collection = resolveAndValidateCollection(execution);
      return collection.size();

    } else {
      throw new ActivitiIllegalArgumentException("Couldn't resolve collection expression nor variable reference");
    }
  }
369736
public void delete(Collection collection) {
        pm.currentTransaction().begin();
        pm.deletePersistentAll(collection);
        pm.currentTransaction().commit();
    }
954634
public void setResolutions(List<Double> resolutions) {
		this.resolutions.clear();
		this.resolutions.addAll(resolutions);
		Collections.sort(this.resolutions, Collections.reverseOrder());
	}
684139
public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
		RESTAssert.assertNotNull(collection, status);
		RESTAssert.assertTrue(collection.size() == 1, status);
	}
1097885
public void setResolvers(java.util.Collection<Resolver> resolvers) {
        if (resolvers == null) {
            this.resolvers = null;
            return;
        }

        this.resolvers = new java.util.ArrayList<Resolver>(resolvers);
    }
860507
protected Plugin resolvePlugin( Plugin plugin, MavenProject project )
    {

        @SuppressWarnings( "unchecked" )
        List<ArtifactRepository> pluginRepositories = project.getPluginArtifactRepositories();
        Artifact artifact =
            factory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifactId(),
                                          VersionRange.createFromVersion( "LATEST" ) );

        try
        {
            this.resolver.resolve( artifact, pluginRepositories, this.local );
            plugin.setVersion( artifact.getVersion() );
        }
        catch ( ArtifactResolutionException e )
        {
        }
        catch ( ArtifactNotFoundException e )
        {
        }

        return plugin;
    }
462469
private File resolveArtifact(ClusterConfiguration config)
            throws ArtifactException, IOException
    {
        String flavour = config.getFlavour();
        String version = config.getVersion();
        String artifactId = getArtifactId(flavour, version);
        String classifier = getArtifactClassifier(version);
        String type = getArtifactType(version);

        ElasticsearchArtifact artifactReference = new ElasticsearchArtifact(artifactId, version, classifier, type);
        config.getLog().debug("Artifact ref: " + artifactReference);

        PluginArtifactResolver artifactResolver = config.getArtifactResolver();
        try
        {
            config.getLog().debug("Resolving artifact against the local maven repo (stage 1)");
            return artifactResolver
                    .resolveArtifact(artifactReference.getArtifactCoordinates());
        }
        catch (ArtifactException e)
        {
            config.getLog().debug("Artifact not found; downloading and installing it");

            File tempFile = downloadArtifact(artifactReference, config);

            config.getLog().debug("Installing " + tempFile + " in the local maven repo");
            config.getArtifactInstaller().installArtifact(
                    artifactReference.getGroupId(),
                    artifactReference.getArtifactId(),
                    artifactReference.getVersion(),
                    artifactReference.getClassifier(),
                    artifactReference.getType(),
                    tempFile);
            
            config.getLog().debug("Resolving artifact against the local maven repo (stage 2)");
            return artifactResolver
                    .resolveArtifact(artifactReference.getArtifactCoordinates());
        }
    }