Search in sources :

Example 6 with ArtifactIncludeFilterTransformer

use of org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer in project maven-plugins by apache.

the class DefaultDependencyResolver method resolve.

private void resolve(Assembly assembly, AssemblerConfigurationSource configSource, Map<DependencySet, Set<Artifact>> result, DependencySet dependencySet, ResolutionManagementInfo info) throws DependencyResolutionException {
    Set<Artifact> artifacts;
    if (info.isResolutionRequired()) {
        final List<ArtifactRepository> repos = aggregateRemoteArtifactRepositories(configSource.getRemoteRepositories(), info.getEnabledProjects());
        artifacts = info.getArtifacts();
        if (info.isResolvedTransitively()) {
            getLogger().debug("Resolving project dependencies transitively.");
            ArtifactFilter filter = new ArtifactIncludeFilterTransformer().transform(info.getScopeFilter());
            artifacts = resolveTransitively(artifacts, repos, filter, configSource);
        } else {
            getLogger().debug("Resolving project dependencies ONLY. " + "Transitive dependencies WILL NOT be included in the results.");
            artifacts = resolveNonTransitively(assembly, artifacts, configSource, repos);
        }
    } else {
        artifacts = new HashSet<Artifact>();
    }
    result.put(dependencySet, artifacts);
}
Also used : ArtifactFilter(org.apache.maven.artifact.resolver.filter.ArtifactFilter) ArtifactIncludeFilterTransformer(org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) Artifact(org.apache.maven.artifact.Artifact)

Aggregations

Artifact (org.apache.maven.artifact.Artifact)6 ArtifactIncludeFilterTransformer (org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer)6 ArtifactFilter (org.apache.maven.artifact.resolver.filter.ArtifactFilter)5 LinkedHashSet (java.util.LinkedHashSet)3 ArtifactResolutionException (org.apache.maven.artifact.resolver.ArtifactResolutionException)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 DefaultArtifact (org.apache.maven.artifact.DefaultArtifact)2 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)2 ArtifactNotFoundException (org.apache.maven.artifact.resolver.ArtifactNotFoundException)2 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 ArtifactResolutionResult (org.apache.maven.artifact.resolver.ArtifactResolutionResult)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 JavadocOptions (org.apache.maven.plugin.javadoc.options.JavadocOptions)1 JavadocOptionsXpp3Reader (org.apache.maven.plugin.javadoc.options.io.xpp3.JavadocOptionsXpp3Reader)1 ScopeFilter (org.apache.maven.shared.artifact.filter.resolve.ScopeFilter)1 TransformableFilter (org.apache.maven.shared.artifact.filter.resolve.TransformableFilter)1 ArtifactResolverException (org.apache.maven.shared.artifact.resolve.ArtifactResolverException)1