Examples of ArtifactFilter


Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

    public static void reportFilteringStatistics( final Collection<ArtifactFilter> filters, final Logger logger )
    {
        for ( final Iterator<ArtifactFilter> it = filters.iterator(); it.hasNext(); )
        {
            final ArtifactFilter f = it.next();

            if ( f instanceof StatisticsReportingArtifactFilter )
            {
                final StatisticsReportingArtifactFilter sFilter = (StatisticsReportingArtifactFilter) f;
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

        Artifact artifact = (Artifact) project.getExtensionArtifactMap().get( extensionId );

        if ( artifact != null )
        {
            ArtifactFilter filter = new ProjectArtifactExceptionFilter( artifactFilter, project.getArtifact() );

            ResolutionGroup resolutionGroup;
            try
            {
                resolutionGroup = artifactMetadataSource.retrieve( artifact, localRepository,
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

                jars.add( url.getPath() );
                jarUrls.add( url );
            }
        }

        ArtifactFilter filter = new ExcludesArtifactFilter( exclusions );

        for ( Artifact a : artifacts )
        {
            if ( "jpox".equals( a.getGroupId() ) && "jpox".equals( a.getArtifactId() ) )
            {
                if ( a.getVersion().equals( databaseFormat.getJpoxVersion() ) )
                {
                    LOGGER.debug( "Adding artifact: " + a.getFile() );
                    jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + SPRING_CONTEXT_LOC );
                    jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + PLEXUS_XML_LOC );
                    jarUrls.add( new URL( FILE_PREFIX + a.getFile().getAbsolutePath() ) );
                }
            }
            else if ( filter.include( a ) )
            {
                LOGGER.debug( "Adding artifact: " + a.getFile() );
                jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + SPRING_CONTEXT_LOC );
                jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + PLEXUS_XML_LOC );
                jarUrls.add( new URL( FILE_PREFIX + a.getFile().getAbsolutePath() ) );
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

        exclusions.add( "org.codehaus.plexus:plexus-component-api" );
        exclusions.add( "org.codehaus.plexus:plexus-container-default" );
        exclusions.add( "org.slf4j:slf4j-api" );
        exclusions.add( "log4j:log4j" );

        ArtifactFilter filter = new ExcludesArtifactFilter( exclusions );

        List<? extends ResolutionListener> listeners;
        if ( LOGGER.isDebugEnabled() )
        {
            listeners = Collections.singletonList( new DebugResolutionListener( container.getLogger() ) );
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

                                // Also, we need to ensure that any exclusions it presents are
                                // added to the artifact before we retrieve the metadata
                                // for the artifact; otherwise we may end up with unwanted
                                // dependencies.
                                Artifact ma = (Artifact) managedVersions.get( childKey );
                                ArtifactFilter managedExclusionFilter = ma.getDependencyFilter();
                                if ( null != managedExclusionFilter )
                                {
                                    if ( null != artifact.getDependencyFilter() )
                                    {
                                        AndArtifactFilter aaf = new AndArtifactFilter();
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

                                                String scope,
                                                ArtifactFactory artifactFactory,
                                                MavenProject project, boolean isAggregator )
        throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException
    {
        ArtifactFilter filter = new ScopeArtifactFilter( scope );

        // TODO: such a call in MavenMetadataSource too - packaging not really the intention of type
        Artifact artifact = artifactFactory.createBuildArtifact( project.getGroupId(), project.getArtifactId(),
                                                                 project.getVersion(), project.getPackaging() );
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

            for (Iterator j = dependency.getExclusions().iterator(); j.hasNext();) {
                Exclusion e = (Exclusion)j.next();
                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
            }

            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);

            art.setDependencyFilter(newFilter);

            artifacts.add(art);
        }
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

            for (Iterator j = dependency.getExclusions().iterator(); j.hasNext();) {
                Exclusion e = (Exclusion)j.next();
                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
            }

            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);

            art.setDependencyFilter(newFilter);

            artifacts.add(art);
        }
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

        final Artifact pomArtifact = config.project().getArtifact();
        final ArtifactRepository localRepo = config.localRepository();
        final List<ArtifactRepository> remoteRepos = config.project().getRemoteArtifactRepositories();
        final ArtifactMetadataSource metadataSource = config.artifactMetadataSource();

        final ArtifactFilter filter = config.filter();
        ArtifactFilter resolutionFilter = null;
        if ( filter != null )
        {
            // Wrap the filter in a ProjectArtifactFilter in order to always include the pomArtifact for resolution.
            // NOTE that this is necessary, b/c the -sources artifacts are added dynamically to the pomArtifact
            // and the resolver also checks the dependency trail with the given filter, thus the pomArtifact has
View Full Code Here

Examples of org.apache.maven.artifact.resolver.filter.ArtifactFilter

            for (Iterator j = dependency.getExclusions().iterator(); j.hasNext();) {
                Exclusion e = (Exclusion)j.next();
                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
            }

            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);

            art.setDependencyFilter(newFilter);

            artifacts.add(art);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.