Examples of ScopeArtifactFilter


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

            Map managedDependencies = Collections.EMPTY_MAP;

            ArtifactFilter filter = null;
            if ( useScope != null )
            {
                filter = new ScopeArtifactFilter( useScope );
            }
            if ( type != null )
            {
                TypeArtifactFilter typeArtifactFilter = new TypeArtifactFilter( type );
                if ( filter != null )
View Full Code Here

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

        // filter scope
        if ( scope != null )
        {
            getLog().debug( "+ Resolving dependency tree for scope '" + scope + "'" );

            filter = new ScopeArtifactFilter( scope );
        }
        else
        {
            filter = null;
        }
View Full Code Here

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

    }

    private void checkScopeUpdate( ArtifactSpec a, ArtifactSpec b, String expectedScope, String expectedVersion )
        throws ArtifactResolutionException, InvalidVersionSpecificationException
    {
        ScopeArtifactFilter filter;
        if ( Artifact.SCOPE_PROVIDED.equals( expectedScope ) )
        {
            filter = new ScopeArtifactFilter( Artifact.SCOPE_COMPILE );
        }
        else if ( Artifact.SCOPE_SYSTEM.equals( expectedScope ) )
        {
            filter = new ScopeArtifactFilter( Artifact.SCOPE_COMPILE );
        }
        else
        {
            filter = new ScopeArtifactFilter( expectedScope );
        }

        ArtifactResolutionResult res = collect( createSet( new Object[]{a.artifact, b.artifact} ), filter );
        Artifact artifact = getArtifact( "d", res.getArtifacts() );
        assertNotNull( "MNG-1895 Dependency was not added to resolution", artifact );
View Full Code Here

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

    }

    private void checkScopeUpdate( ArtifactSpec a, ArtifactSpec b, String expectedScope, String expectedVersion )
        throws ArtifactResolutionException, InvalidVersionSpecificationException
    {
        ScopeArtifactFilter filter;
        if ( Artifact.SCOPE_PROVIDED.equals( expectedScope ) )
        {
            filter = new ScopeArtifactFilter( Artifact.SCOPE_COMPILE );
        }
        else if ( Artifact.SCOPE_SYSTEM.equals( expectedScope ) )
        {
            filter = new ScopeArtifactFilter( Artifact.SCOPE_COMPILE );
        }
        else
        {
            filter = new ScopeArtifactFilter( expectedScope );
        }

        ArtifactResolutionResult res = collect( createSet( new Object[] { a.artifact, b.artifact } ), filter );
        Artifact artifact = getArtifact( "d", res.getArtifacts() );
        assertNotNull( "MNG-1895 Dependency was not added to resolution", artifact );
View Full Code Here

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

    Set newDependencies = new HashSet();

    for (Iterator iterator = artifacts.iterator(); iterator.hasNext();)
    {
      Artifact artifact = (Artifact) iterator.next();
      ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE);
      if ("warpath".equals(artifact.getType()) && filter.include(artifact) && !artifact.isOptional())
      {
        //need to include classes directory.
        String warWorkingDir = getDefaultFinalName(artifact);

        getLog().debug("Processing war dependency " + warWorkingDir);
View Full Code Here

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

            mavenProjectBuilder.buildFromRepository(artifact, this.remoteRepos, this.local);
        if (pomProject.getDependencyArtifacts() == null) {
            pomProject.setDependencyArtifacts(pomProject
                .createArtifacts(factory,
                                 null, // Artifact.SCOPE_TEST,
                                 new ScopeArtifactFilter(Artifact.SCOPE_TEST)));
        }
        ArtifactResolutionResult result =
            resolver.resolveTransitively(pomProject.getDependencyArtifacts(),
                                         pomProject.getArtifact(),
                                         remoteRepos,
View Full Code Here

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

    private void addDependencies(Archiver archiver)
            throws ArchiverException, MojoExecutionException {
       
        Log log = getLog();
        AndArtifactFilter filter = new AndArtifactFilter();
        filter.add(new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME));
        filter.add(new ArtifactFilter() {
            public boolean include(Artifact artifact) {
                return !artifact.isOptional();
            }
        });
View Full Code Here

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

        }
       
        log.debug("Initializing class scanner ...");
        ClassScanner scanner = new ClassScanner(buildOutputDirectory);
        for (Artifact artifact : filterArtifacts(project.getArtifacts(),
                new ScopeArtifactFilter(Artifact.SCOPE_COMPILE))) {
            scanner.addToClasspath(artifact.getFile());
        }
        List<ServiceLocator> serviceLocators =
            new ArrayList<ServiceLocator>(serviceClassNames.length);
        for (String serviceClassName : serviceClassNames) {
View Full Code Here

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

                                                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.ScopeArtifactFilter

                                                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
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.