Package org.apache.maven.artifact.resolver.filter

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


    Set<Artifact> classpathArtifacts = (Set<Artifact>) project.getArtifacts();

    if (!Strings.isNullOrEmpty(classpathDependencyScopeExclude)) {
      classpathArtifacts = filterArtifacts(cp, classpathArtifacts,
          new ScopeArtifactFilter(classpathDependencyScopeExclude));
    }

    if (classpathDependencyExcludes != null && !classpathDependencyExcludes.isEmpty()) {
      classpathArtifacts = filterArtifacts(cp, classpathArtifacts,
          new PatternIncludesArtifactFilter(classpathDependencyExcludes));
View Full Code Here


        {
            @SuppressWarnings("unchecked")
            Set<Artifact> artifacts = project.getArtifacts();
            for (Artifact artifact : artifacts) {

                ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
                if (!artifact.isOptional() && filter.include(artifact)
                        && artifact.getArtifactHandler().isAddedToClasspath()) {
                    getLog().info("Copying artifact[" + artifact.getGroupId() + ", " + artifact.getId() + ", "
                            + artifact.getScope() + "]");
                    FileUtils.copyFileToDirectory(artifact.getFile(), getBuildDir());
                }
View Full Code Here

                                + targetFileName;
                        getLog().debug("Renamed to: " + targetFileName);
                    }

                    // TODO: utilise appropriate methods from project builder
                    ScopeArtifactFilter filter = new ScopeArtifactFilter(
                            Artifact.SCOPE_RUNTIME);
                    if (!artifact.isOptional() && filter.include(artifact)) {
                        String type = artifact.getType();
                        if ("jar".equals(type)) {
                            copyFileIfModified(artifact.getFile(), new File(
                                    libDir, targetFileName));
                        }
View Full Code Here

        try {
            ArtifactResolutionResult result = artifactResolver.resolveTransitively(
                    processorArtifacts, project.getArtifact(),
                    localRepository,
                    this.project.getRemoteArtifactRepositories(),
                    metadataSource, new ScopeArtifactFilter("runtime"));
            for( Artifact a : (Set<Artifact>)result.getArtifacts()) {
                classpaths.add(a.getFile().toURL());
            }
        } catch (AbstractArtifactResolutionException e) {
            throw new CompilerException("Failed to resolve annotation processors",e);
View Full Code Here

                    targetFileName = artifact.getGroupId() + "-" + targetFileName;
                    getLog().debug( "Renamed to: " + targetFileName );
                  }
   
                  // TODO: utilise appropriate methods from project builder
                  ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
                  if ( !artifact.isOptional() && filter.include( artifact ) )
                  {
                    String type = artifact.getType();
                    if ( "jar".equals( type ) )
                    {
                      copyFileIfModified( artifact.getFile(), new File( libDir, targetFileName ) );
View Full Code Here

            } else {
                artifacts = project.getDependencyArtifacts();
            }
            for (Artifact artifact : artifacts) {

                ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
                if (!artifact.isOptional() && filter.include(artifact)) {
                    getLog().info("Copying artifact[" + artifact.getGroupId() + ", " + artifact.getId() + ", " +
                            artifact.getScope() + "]");
                    zipArchiver.addFile(artifact.getFile(), artifact.getArtifactId() + "-" + artifact.getVersion() + "." + (artifact.getType() == null ? "jar" : artifact.getType()));
                }
            }
View Full Code Here

        info.setVersion(project.getVersion());
        info.setName(project.getArtifactId());
        info.setType("jar");
        uris.add(info);

        ScopeArtifactFilter filter = new ScopeArtifactFilter(
                Artifact.SCOPE_RUNTIME);

        JbiResolutionListener listener = resolveProject();
        // print(listener.getRootNode(), "");

        Set includes = new HashSet();
        for (Iterator iter = project.getArtifacts().iterator(); iter.hasNext();) {
            Artifact artifact = (Artifact) iter.next();
            if (!artifact.isOptional() && filter.include(artifact)) {
                MavenProject project = null;
                try {
                    project = projectBuilder.buildFromRepository(artifact,
                            remoteRepos, localRepo);
                } catch (ProjectBuildingException e) {
View Full Code Here

        } catch (IOException e) {
            throw new JbiPluginException("Unable to copy file "
                    + projectArtifact, e);
        }

        ScopeArtifactFilter filter = new ScopeArtifactFilter(
                Artifact.SCOPE_RUNTIME);

        JbiResolutionListener listener = resolveProject();
        // print(listener.getRootNode(), "");

        Set includes = new HashSet();
        for (Iterator iter = project.getArtifacts().iterator(); iter.hasNext();) {
            Artifact artifact = (Artifact) iter.next();
            if (!artifact.isOptional() && filter.include(artifact)) {
                MavenProject project = null;
                try {
                    project = projectBuilder.buildFromRepository(artifact,
                            remoteRepos, localRepo);
                } catch (ProjectBuildingException e) {
View Full Code Here

            Map<String,Artifact> managedDependencies = pom.getMavenProject().getManagedVersionMap();

            ArtifactFilter filter = null;
            if ( useScope != null )
            {
                filter = new ScopeArtifactFilter( useScope );
            }
            if ( scopes != null )
            {
                filter = new SpecificScopesArtifactFilter( scopes );
            }
View Full Code Here

        @SuppressWarnings( "unchecked" ) Set<Artifact> classpathArtifacts = getProject().getArtifacts();

        if ( getClasspathDependencyScopeExclude() != null && !getClasspathDependencyScopeExclude().equals( "" ) )
        {
            ArtifactFilter dependencyFilter = new ScopeArtifactFilter( getClasspathDependencyScopeExclude() );
            classpathArtifacts = this.filterArtifacts( classpathArtifacts, dependencyFilter );
        }

        if ( getClasspathDependencyExcludes() != null )
        {
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter

Copyright © 2018 www.massapicom. 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.